Bug 4466 - abort() on ARM produces core file that you can't backtrace.
Summary: abort() on ARM produces core file that you can't backtrace.
Status: RESOLVED INVALID
Alias: None
Product: uClibc
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: Other Linux
: P5 minor
Target Milestone: ---
Assignee: unassigned
URL: http://lists.uclibc.org/pipermail/ucl...
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-10 14:28 UTC by Grant Edwards
Modified: 2013-02-19 08:24 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Grant Edwards 2011-11-10 14:28:30 UTC
At least on the ARM architecture, calling the abort() function results
in a core file with no return PC on the stack. That means you can't
subsequently use gdb to do a backtrace to find out where abort() was
called.

I presume this is due to the "noreturn" function attribute.  I propose
that attribute be removed.  It's saving one word of stack space and
one instruction in a function that's called at most once (and then
only to terminate the program).

In my opinion, exit() should also have the "noreturn" attribute
removed.

In cases like abort() and exit(), the "noreturn" attribute results in
sacrificing significant functionality for a completely valueless
"optimization".

Or does somebody has some profiling results showing that abort()
pushing the return address onto the stack is causing a noticable
performance reduction in their program?  ;)
Comment 1 Mike Frysinger 2011-11-20 07:52:15 UTC
inability for gdb/gcc to cross noreturn attribute funcs is most likely unrelated to the C library
Comment 2 Mike Frysinger 2013-02-19 08:24:22 UTC
for posterity, here is the fix that went into gcc:
http://gcc.gnu.org/ml/gcc-patches/2009-11/msg01234.html