[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[patches] Remove "nonreturn" declaration from abort



This suggestion was already rejected for glibc (even though having the
support of Richard Stallman) by Ulrich Drepper.  But maybe it is
interesting for this project:

The distinguishing feature of the abort library call (as opposed to
exit(255) or similar) is that it delivers a core dump, or equivalently
can be used for debugging.

Having this function marked as noreturn (like it is presently done and
like is the case with exit) means that gcc or other compilers feel free
to share one call to abort between several independent callers, and not
bother having the stack in a presentable manner.

So marking abort as "noreturn" is sabotaging its main purpose,
debuggability.  This is not mere theory: I spent several days
desperately debugging a failed assertion which actually occured in quite
a different location.  And I know of several other people who had the
exact same problem when debugging.

I don't actually include a patch: it would just consist of removing the
respective declaration from the abort call.  I can't vouch that gcc
itself has builtin "knowledge" here, too, but fixing the library
declaration would be a first step.

-- 
David Kastrup