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 |
Description
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, assert
ion 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
Milestone: | → 8.0.0 |
---|
comment:2 Changed 5 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
To address this issue, several changes have been made to
stx:librun
(aka the VM). Since C99 is clear in that a call toabort()
terminates the process, we do not try to circumvent his. Besides, on Linux this would require some really black magic.Instead, on
abort()
(and alsoassert()
ion failure which in turn callabort()
, the VM dumps kind of a crash report tostdout
. The VM also can be instructed to stop and wait for debugger to attach would the user wish to investigate the issue in debugger. Seesmalltalk -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:
__stop()
with newstxDebugWaitForDebugger()
__abort()
by calls to C99'sabort()
stxDebugInit()
to initialize debug support.--stopOnAbort
--abortOn*
and--stopOn*
optionsstxDebugCrashReportPrint()