public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug threads/10757] New: GDB does not attach all threads of a multithreaded process => inferior gets SIGTRAP
@ 2009-10-11 17:19 ppluzhnikov at google dot com
  2009-10-11 17:22 ` [Bug threads/10757] " ppluzhnikov at google dot com
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: ppluzhnikov at google dot com @ 2009-10-11 17:19 UTC (permalink / raw)
  To: gdb-prs

Possibly related to PR8963.

This was originally reported with gdbserver across a relatively high-latency
connection: attach remote process, set breakpoints, continue:

  Program terminated with signal SIGTRAP, Trace/breakpoint trap.
  The program no longer exists.

Reproduces with attached test case on Fedora 11 with both
  GNU gdb (GDB) Fedora (6.8.50.20090302-38.fc11)
  GNU gdb (GDB) 7.0.50.20091011-cvs

$ ulimit -s 32
$ ./a.out 20 &
[2] 16717

$ ~/gdb-cvs/build/gdb/gdb --pid $(pgrep a.out)
GNU gdb (GDB) 7.0.50.20091011-cvs
...
This GDB was configured as "i686-pc-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Attaching to process 16717
Reading symbols from /home/paul/tmp/a.out...done.
Reading symbols from /lib/libpthread.so.0...Reading symbols from
/usr/lib/debug/lib/libpthread-2.10.1.so.debug...done.
[Thread debugging using libthread_db enabled]
[New Thread 0xb7f3eb70 (LWP 5139)]
(no debugging symbols found)...done.
Loaded symbols for /lib/libpthread.so.0
Reading symbols from /lib/libc.so.6...Reading symbols from
/usr/lib/debug/lib/libc-2.10.1.so.debug...done.
(no debugging symbols found)...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-linux.so.2...Reading symbols from
/usr/lib/debug/lib/ld-2.10.1.so.debug...done.
(no debugging symbols found)...done.
Loaded symbols for /lib/ld-linux.so.2
0x001ef424 in __kernel_vsyscall ()
(gdb) b foo
Breakpoint 1 at 0x80485c7: file manythreads2.c, line 10.
(gdb) commands 1
>c
>end
(gdb) c
[Thread 0xb7f3eb70 (LWP 5139) exited]

Program terminated with signal SIGTRAP, Trace/breakpoint trap.
The program no longer exists.
(gdb) quit
[2]+  Trace/breakpoint trap   (core dumped) ./a.out 20


It appears that to trigger the bug, I need a program which rapidly creates
threads while gdb/gdbserver is attaching.

The same program works fine when started from within GDB. Race in attach?

-- 
           Summary: GDB does not attach all threads of a multithreaded
                    process => inferior gets SIGTRAP
           Product: gdb
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: threads
        AssignedTo: unassigned at sourceware dot org
        ReportedBy: ppluzhnikov at google dot com
                CC: gdb-prs at sourceware dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://sourceware.org/bugzilla/show_bug.cgi?id=10757

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

end of thread, other threads:[~2009-12-08 17:19 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-11 17:19 [Bug threads/10757] New: GDB does not attach all threads of a multithreaded process => inferior gets SIGTRAP ppluzhnikov at google dot com
2009-10-11 17:22 ` [Bug threads/10757] " ppluzhnikov at google dot com
2009-10-11 21:47 ` ppluzhnikov at google dot com
2009-10-11 22:28 ` pedro at codesourcery dot com
2009-10-11 22:33 ` pedro at codesourcery dot com
2009-10-11 23:27 ` ppluzhnikov at google dot com
2009-10-11 23:51 ` pedro at codesourcery dot com
2009-10-12  0:56 ` pedro at codesourcery dot com
2009-10-12  1:10 ` pedro at codesourcery dot com
2009-10-12 10:40 ` jan dot kratochvil at redhat dot com
2009-10-15 18:17 ` cvs-commit at gcc dot gnu dot org
2009-10-27 21:33 ` cvs-commit at gcc dot gnu dot org
2009-10-28 17:03 ` cvs-commit at gcc dot gnu dot org
2009-10-31 15:05 ` pedro at codesourcery dot com
2009-10-31 17:26 ` ppluzhnikov at google dot com
2009-12-08 17:11 ` ppluzhnikov at google dot com
2009-12-08 17:19 ` esigra at gmail dot com

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).