Opened 5 years ago

Closed 5 years ago

Last modified 4 years ago

#123 closed enhancement (fixed)

Check stack size to be large enough

Reported by: Thore Böckelmann Owned by: Thore Böckelmann
Priority: normal Milestone: 3.9-2015R1
Component: Application.mui Version: 3.9-2014R3
Severity: minor Keywords:
Cc: OS Platform: All
Blocked By: Blocking:
Release Notes:

Implemented a simple stack size check to avoid unexpected crashes due to loo low stack sizes. The recommended minimum stack size is 32768 bytes.

Description (last modified by Thore Böckelmann)

Problem

MUI 3.8 already demanded more stack than the default 8K provided by the system. With MUI 3.9 this requirement has increased even more. Without enough (free) stack certain applications will just crash.

Analysis

Ticket #116 has proven that a stack size of 16K or 20K might be enough, but 32K is definitely a better choice and should be used as an absolute minimum requirement.

Enhancement recommendation

To avoid future crashes the application's stack size should be checked to be at least 32K when creating an instance of Application.mui as this the absolute basic for an MUI application. If the current stack size is found to be lower a warning should be shown to the user with the ability to abort the application early to avoid possible crashes due to the too low stack size.

AmigaOS4 does lots harder to provide a bigger stack even if an application's icon requests loo little stack when started from Workbench. AmigaOS3 would require lots of patches for this to archive. In general it does not harm to have such a check for all systems.

Change History (5)

comment:1 Changed 5 years ago by Thore Böckelmann

Description: modified (diff)

comment:2 Changed 5 years ago by Thore Böckelmann

Owner: set to Thore Böckelmann
Resolution: fixed
Status: newclosed

In 4232:

  • Application.c: implemented a simple stack size check to avoid unexpected crashes due to loo low stack sizes. The recommended minimum stack size is 32768 bytes. Due to the way MUI applications are usually created a lot more than the default 8192 bytes of stack is required. This larger requirement has always existed, but still many developers don't ensure a large enough stack by adding $STACK cookies the the source code or by setting an appropriate stack size in the program's icon. This closes #123.

comment:3 Changed 5 years ago by Thore Böckelmann

Release Notes: modified (diff)

comment:4 Changed 4 years ago by Thore Böckelmann

Milestone: MUI 3.9-2014R4MUI 3.9-2015R1

Milestone renamed

comment:5 Changed 4 years ago by Thore Böckelmann

Milestone: MUI 3.9-2015R13.9-2015R1

Milestone renamed

Note: See TracTickets for help on using tickets.