Opened 11 years ago

Closed 6 years ago

Last modified 5 years ago

#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 pulkomandy)

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 pulkomandy, 11 years ago

Description: modified (diff)

comment:2 by anevilyak, 11 years ago

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.

comment:3 by pulkomandy, 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 luroh, 10 years ago

Milestone: R1Unscheduled

Move POSIX compatibility related tickets out of R1 milestone (FutureHaiku/Features).

comment:5 by waddlesplash, 6 years ago

Resolution: fixed
Status: newclosed

Fixed in hrev52788.

comment:6 by nielx, 5 years ago

Milestone: UnscheduledR1/beta2

Assign tickets with status=closed and resolution=fixed within the R1/beta2 development window to the R1/beta2 Milestone

Note: See TracTickets for help on using tickets.