#10295 closed enhancement (fixed)
assert() does not call abort()
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.
Change History (6)
comment:1 by , 11 years ago
Description: | modified (diff) |
---|
comment:2 by , 11 years ago
comment:3 by , 11 years ago
I was thinking of storing that in a global and retrieving it from there in the handler, but I agree it's not the perfect solution.
comment:4 by , 10 years ago
Milestone: | R1 → Unscheduled |
---|
Move POSIX compatibility related tickets out of R1 milestone (FutureHaiku/Features).
comment:6 by , 5 years ago
Milestone: | Unscheduled → R1/beta2 |
---|
Assign tickets with status=closed and resolution=fixed within the R1/beta2 development window to the R1/beta2 Milestone
I don't think the
call debugger() from the default SIGABRT handler
approach can work equivalently, as you'd no longer have access to the assert message/condition at that point, which is pretty much the biggest reason for calling debugger() instead.