Bug 4466

Summary: abort() on ARM produces core file that you can't backtrace.
Product: uClibc Reporter: Grant Edwards <grant.b.edwards>
Component: OtherAssignee: unassigned
Status: RESOLVED INVALID    
Severity: minor CC: uclibc-cvs
Priority: P5    
Version: unspecified   
Target Milestone: ---   
Hardware: Other   
OS: Linux   
URL: http://lists.uclibc.org/pipermail/uclibc/2011-November/045921.html
Host: Target:
Build:

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