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

Bug#219459: NPTL breaks abort()



On Thu, Nov 06, 2003 at 05:39:23PM +0000, Andrew Suffield wrote:
> Package: libc6
> Severity: important
> 
> This may turn out to be a gdb bug, but let's start here...

That just means GDB can't backtrace through abort.  The compiler knows
that abort is a noreturn function, and is allowed to take all sorts of
liberties with the calling sequence - there's very little the debugger
can do.

You won't be able to get a backtrace at least until GDB and your kernel
agree on how to dump the sysinfo DSO to a core dump and how to parse
it.  The code's still being worked on.


> asuffield@cyclone:~$ cat foo.c
> int main(void)
> {
>   abort();
> }
> asuffield@cyclone:~$ gcc -o foo foo.c
> asuffield@cyclone:~$ ./foo
> Aborted (core dumped)
> asuffield@cyclone:~$ gdb foo core
> GNU gdb 6.0-debian
> Copyright 2003 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you are
> welcome to change it and/or distribute copies of it under certain conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB.  Type "show warranty" for details.
> This GDB was configured as "i386-linux"...
> Core was generated by `./foo'.
> Program terminated with signal 6, Aborted.
> 
> warning: current_sos: Can't read pathname for load map: Input/output error
> 
> Reading symbols from /lib/tls/libc.so.6...done.
> Loaded symbols for /lib/tls/libc.so.6
> Reading symbols from /lib/ld-linux.so.2...done.
> Loaded symbols for /lib/ld-linux.so.2
> #0  0x4004cd89 in raise () from /lib/tls/libc.so.6
> (gdb) bt
> #0  0x4004cd89 in raise () from /lib/tls/libc.so.6
> #1  0x40158f70 in ?? () from /lib/tls/libc.so.6
> #2  0xbffff7c0 in ?? ()
> #3  0x4004e5e1 in abort () from /lib/tls/libc.so.6
> (gdb) q
> asuffield@cyclone:~$ LD_ASSUME_KERNEL=2.4.1 ./foo
> Aborted (core dumped)
> asuffield@cyclone:~$ gdb foo core
> GNU gdb 6.0-debian
> Copyright 2003 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you are
> welcome to change it and/or distribute copies of it under certain conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB.  Type "show warranty" for details.
> This GDB was configured as "i386-linux"...
> Core was generated by `./foo'.
> Program terminated with signal 6, Aborted.
> 
> warning: current_sos: Can't read pathname for load map: Input/output error
> 
> Reading symbols from /lib/libc.so.6...done.
> Loaded symbols for /lib/libc.so.6
> Reading symbols from /lib/ld-linux.so.2...done.
> Loaded symbols for /lib/ld-linux.so.2
> #0  0x4004c551 in kill () from /lib/libc.so.6
> (gdb) bt
> #0  0x4004c551 in kill () from /lib/libc.so.6
> #1  0x4004c2f5 in raise () from /lib/libc.so.6
> #2  0x4004d7e8 in abort () from /lib/libc.so.6
> #3  0x08048359 in main ()
> (gdb) q
> 
> 
> Note how when using the NPTL version of the library, the stack trace
> does not contain the caller of abort() or anything that preceeded it;
> this makes abort() mostly useless, and the generated core dump
> entirely useless.
> 
> -- 
>   .''`.  ** Debian GNU/Linux ** | Andrew Suffield
>  : :' :  http://www.debian.org/ |
>  `. `'                          |
>    `-             -><-          |



-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer



Reply to: