gdb/2241: Different errno when program signalled from gdb

chris.auston@crsoftwareinc.com chris.auston@crsoftwareinc.com
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
>Closed-Date:
>Last-Modified:
>Originator:     chris.auston@crsoftwareinc.com
>Release:        GNU gdb 6.6
>Organization:
>Environment:
Linux doughnuthole.crsoftwareinc.com 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"...
>Description:
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.
>How-To-Repeat:
[crsd@doughnuthole gdberr]$ ./gdberr 
Generate SIGINT to interrupt me...
errno=4

[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/libthread_db.so.1".
(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.
errno=514

Program exited normally.
(gdb) 

[crsd@doughnuthole gdberr]$ ldd gdberr 
        libpthread.so.0 => /lib/tls/libpthread.so.0 (0x00675000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00799000)
        libm.so.6 => /lib/tls/libm.so.6 (0x0063e000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x0077f000)
        libc.so.6 => /lib/tls/libc.so.6 (0x0050b000)
        /lib/ld-linux.so.2 (0x009ae000)
[crsd@doughnuthole gdberr]$ ls -l /lib/tls/libpthread*
-rwxr-xr-x  1 root root 107952 Aug 12  2006 /lib/tls/libpthread-2.3.4.so
lrwxrwxrwx  1 root root     19 Mar 24 21:21 /lib/tls/libpthread.so.0 -> libpthread-2.3.4.so
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="gdberr.bz2"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="gdberr.bz2"

QlpoOTFBWSZTWbImz/8AAa7/hsywAEB+9/+fe+f87//v3z4AAIAAgAhAAjzd3EuVBpI00TFHpPFN
ijyh4iYTACepkaANGAaQAaKaTyNKeYRT0T0mnqNAeoAABoAAAaNArFNQeoB6gDQAAAA0AAAADQBI
pGgEFPaKeTSG1B6mI0AD01G1NBoDanqA2k5Vy+7HkOv0zJ2MEnQkJGaObMQ3lmUIyEt+tBQlamIC
CqWpq1iOd/3m175Km99zzEvQ0fjq8WfZNNKKNJgkBpOJRagsWzXRh96U+kcgUMT0XyJP4/ChsaTX
cgPdMLtByXYCAgIpI+06QJ8ZN0bZlIQfRCMoImR3JeShwYrhUUnTxJ9unRC85Qx3DzSxoidSUUhQ
g8KGCWfMYwU54ojUo36It80TTd4WeeYutmIF84EAFD68Audr0td7rJqiiENShFccdDbRoUXphAbT
46iuEK6JpDXpokqTKGrCE8pNBQYpopjDivYcuc2MWap30GoZ23vcPfk/iXi+x8tAnsibZtwhAzi8
ouGhqDWoMs2WB1WOjWfAnrZDLG1sy7hKkseRfsr8iuNYskgS+91gTwd6olGQjeYncbBLPwDLpeoH
Q0RNrYq+QXMf4P38BdCWEqPValJljVWTH0z7ZN1sr2ljCirZ1UNmKYVID0NAohPegiYU5V3YbJxM
gf3jdynJYR1kUQy2i88xS2Ip5cRE4MSL8tsZMkksiQqK9atCB7gsQik0JUhTgskK5rm0rkxEEoGS
BgNwjOpUsd53JyVlGuW2vIVY2pluZjiM5igMwDDtAUBdYWolECuAjKAPSpEKuqArmVdRT9mgvKks
WWIaMl9q4T2QYqZZBkTdrxOiS8lPjTWDpWDD2KQjeW5YETFwCA/4u5IpwoSFkTZ/+A==



More information about the Gdb-prs mailing list