Opened 6 years ago

Closed 8 months ago

#10295 closed enhancement (fixed)

assert() does not call abort()

Reported by: pulkomandy Owned by: nobody
Priority: normal Milestone: Unscheduled
Component: System/POSIX Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no 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 (5)

comment:1 by pulkomandy, 6 years ago

Description: modified (diff)

comment:2 by anevilyak, 6 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, 6 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, 5 years ago

Milestone: R1Unscheduled

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

comment:5 by waddlesplash, 8 months ago

Resolution: fixed
Status: newclosed

Fixed in hrev52788.

Note: See TracTickets for help on using tickets.