gdb/2241: Different errno when program signalled from gdb
Mon Mar 26 16:38:00 GMT 2007

>Number:         2241
>Category:       gdb
>Synopsis:       Different errno when program signalled from gdb
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Mar 26 17:38:01 BST 2007
>Release:        GNU gdb 6.6
Linux 2.6.9-42.0.10.EL #1 Tue Feb 27 09:24:42 EST 2007 i686 i686 i386 GNU/Linux

Reading specs from /usr/lib/gcc/i386-redhat-linux/3.4.6/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-java-awt=gtk --host=i386-redhat-linux
Thread model: posix
gcc version 3.4.6 20060404 (Red Hat 3.4.6-3)

This GDB was configured as "i686-pc-linux-gnu"...
I get a different value for errno when signalling a program in gdb and outside gdb. Running the program by itself and sending SIGINT will yield the correct result EINTR. But when I interrupt gdb and use the "signal 2" command I get errno=514 which is invalid.

I suspect I have a configuration issue, but cannot find any reference for it on the net. It strikes me as a TLS problem since errno should be such a variable.
[crsd@doughnuthole gdberr]$ ./gdberr 
Generate SIGINT to interrupt me...

[crsd@doughnuthole gdberr]$ gdb gdberr 
GNU gdb 6.6
Copyright (C) 2006 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 "i686-pc-linux-gnu"...
Using host libthread_db library "/lib/tls/".
(gdb) r
Starting program: /home/crsd/gdberr/gdberr 
[Thread debugging using libthread_db enabled]
[New Thread -1208489328 (LWP 22061)]
Generate SIGINT to interrupt me...

Program received signal SIGINT, Interrupt.
[Switching to Thread -1208489328 (LWP 22061)]
0x00d958d2 in _dl_sysinfo_int80 () at rtld.c:576
576     relocate_doit (void *a)
Current language:  auto; currently c
(gdb) sig 2
Continuing with signal SIGINT.

Program exited normally.

[crsd@doughnuthole gdberr]$ ldd gdberr => /lib/tls/ (0x00675000) => /usr/lib/ (0x00799000) => /lib/tls/ (0x0063e000) => /lib/ (0x0077f000) => /lib/tls/ (0x0050b000)
        /lib/ (0x009ae000)
[crsd@doughnuthole gdberr]$ ls -l /lib/tls/libpthread*
-rwxr-xr-x  1 root root 107952 Aug 12  2006 /lib/tls/
lrwxrwxrwx  1 root root     19 Mar 24 21:21 /lib/tls/ ->

Content-Type: application/octet-stream; name="gdberr.bz2"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="gdberr.bz2"


More information about the Gdb-prs mailing list