public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* Re: gdb/2241: Different errno when program signalled from gdb
@ 2007-08-31  9:48 Matthieu CASTET
  0 siblings, 0 replies; 3+ messages in thread
From: Matthieu CASTET @ 2007-08-31  9:48 UTC (permalink / raw)
  To: nobody; +Cc: gdb-prs

The following reply was made to PR gdb/2241; it has been noted by GNATS.

From: Matthieu CASTET <matthieu.castet@parrot.com>
To: gdb-gnats@sources.redhat.com
Cc:  
Subject: Re: gdb/2241: Different errno when program signalled from gdb
Date: Fri, 31 Aug 2007 11:41:23 +0200

 I got the same problem with gdb producing on read syscall, an errno of 
 512 (ERESTARTSYS).
 
 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: gdb/2241: Different errno when program signalled from gdb
@ 2007-03-26 17:38 Daniel Jacobowitz
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Jacobowitz @ 2007-03-26 17:38 UTC (permalink / raw)
  To: nobody; +Cc: gdb-prs

The following reply was made to PR gdb/2241; it has been noted by GNATS.

From: Daniel Jacobowitz <drow@false.org>
To: chris.auston@crsoftwareinc.com
Cc: gdb-gnats@sources.redhat.com
Subject: Re: gdb/2241: Different errno when program signalled from gdb
Date: Mon, 26 Mar 2007 13:33:07 -0400

 On Mon, Mar 26, 2007 at 04:31:44PM -0000, chris.auston@crsoftwareinc.com wrote:
 > 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) 
 
 FYI, I can reproduce this.  514 is ERESTARTNOHAND, a Linux internal
 errno code used for interrupted syscalls.  We've manually interrupted
 the syscall.
 
 I'm not entirely sure if this should be considered a GDB or kernel
 bug... someone will have to consider how the two should work together.
 It seems like the syscall should have been restarted.
 
 -- 
 Daniel Jacobowitz
 CodeSourcery


^ permalink raw reply	[flat|nested] 3+ messages in thread

* gdb/2241: Different errno when program signalled from gdb
@ 2007-03-26 16:38 chris.auston
  0 siblings, 0 replies; 3+ messages in thread
From: chris.auston @ 2007-03-26 16:38 UTC (permalink / raw)
  To: gdb-gnats


>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==


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-08-31  9:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-31  9:48 gdb/2241: Different errno when program signalled from gdb Matthieu CASTET
  -- strict thread matches above, loose matches on Subject: below --
2007-03-26 17:38 Daniel Jacobowitz
2007-03-26 16:38 chris.auston

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).