Opened 11 years ago
Last modified 5 years ago
#10295 closed enhancement
assert() does not call abort() — at Version 1
Reported by: | pulkomandy | Owned by: | nobody |
---|---|---|---|
Priority: | normal | Milestone: | R1/beta2 |
Component: | System/POSIX | Version: | R1/Development |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description (last modified by )
Our implementation of assert() calls debugger(). POSIX says it should call abort(). http://pubs.opengroup.org/onlinepubs/9699919799/functions/assert.html
This would be useful to catch assertions from inside the application (by setting a SIGABRT handler). I wanted to use that in the WebKit testsuite to avoid the debug_server crash dialog, and save a crash report instead. However, the team is killed without having a chance to intercept anything (with or without disable_debugger()). The kill is done with SIGKILL which can't be intercepted with a signal handler.
I'm not sure how to do this while keeping the current functionality. Maybe the call to debugger() may happen in the default SIGABRT handler, or maybe we could call SIGABRT only when disable_debugger() was set. The latter is still not POSIX compliant, however.