Faculty of Information Technology
Software Engineering Group

Opened 7 years ago

Closed 5 years ago

#100 closed todo (fixed)

Revise and improve handling of SIGABRT and abort()

Reported by: Jan Vrany Owned by:
Priority: major Milestone: 8.0.0
Component: default Keywords:
Cc: Also affects CVS HEAD (eXept version): no


Currently a call to abort() and subsequent SIGABRT terminates the VM process as usual. While this is the intention of
abort(), the default behavior is bit unfortunate. There are numerous misbehaved libraries that just call abort() or even exit() (even malloc() does so!) Also, assertion failure often leads to call to the abort().

Smalltalk/X should, at least, dump stack traces of all Smalltalk processes, marking the current one so user knows what has happened. Maybe a new VM option - --dumpOnAbort - should be provided to generate a core dump (minidump on Windows, though usefulness of minidump without having PDB debug data is questionable).

An open question is whether we should allow for ignoring abort() completely and pop up a Smalltalk debugger the same way it is done for SIGSEGV. At least under POSIX systems that would be technically tricky as POSIX-compliant abort() is very determined to terminate the process at all costs (see the spec :-)

Change History (2)

comment:1 Changed 6 years ago by Jan Vrany

Milestone: 8.0.0

comment:2 Changed 5 years ago by Jan Vrany

Resolution: fixed
Status: newclosed

To address this issue, several changes have been made to stx:librun (aka the VM). Since C99 is clear in that a call to abort() terminates the process, we do not try to circumvent his. Besides, on Linux this would require some really black magic.

Instead, on abort() (and also assert()ion failure which in turn call abort(), the VM dumps kind of a crash report to stdout. The VM also can be instructed to stop and wait for debugger to attach would the user wish to investigate the issue in debugger. See smalltalk -help, section "debugging" for command line switches to control the behavior.

The feature to stop and wait for debugger is now supported also on Windows.

For details see commits:

Note: See TracTickets for help on using tickets.