This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug threads/10757] GDB does not attach all threads of a multithreaded process => inferior gets SIGTRAP


------- Additional Comments From ppluzhnikov at google dot com  2009-10-11 21:47 -------
The same problem appears to happen on Solaris-10/i686 with GDB-6.6 (which Sun
ships), but not with GDB-cvs.

[1]+  Running                 ./a.out 40 &
$ gdb ./a.out 26519                    
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 "i386-pc-solaris2.10"...
Attaching to program `/export/home/paul/tmp/a.out', process 26519
Reading symbols from /lib/libpthread.so.1...
warning: Lowest section in /lib/libpthread.so.1 is .dynamic at 00000074
done.
Loaded symbols for /lib/libpthread.so.1
Reading symbols from /lib/libc.so.1...done.
Loaded symbols for /lib/libc.so.1
Reading symbols from /lib/ld.so.1...done.
Loaded symbols for /lib/ld.so.1
sol-thread active.
Retry #1:
Retry #2:
Retry #3:
Retry #4:
[New LWP    1        ]
[New Thread 1 (LWP 1)]
Symbols already loaded for /lib/libpthread.so.1
Symbols already loaded for /lib/libc.so.1
Symbols already loaded for /lib/ld.so.1
[Switching to Thread 1 (LWP 1)]
0xfef19735 in ___nanosleep () from /lib/libc.so.1
(gdb) b foo
Breakpoint 1 at 0x8050a83: file manythreads.c, line 10.
(gdb) c
Continuing.
[New LWP    183438        ]
[New LWP    186777        ]
[New LWP    186756        ]
[New LWP    186778        ]
[New Thread 183438 (LWP 183438)]
[Switching to Thread 183438 (LWP 183438)]

Breakpoint 1, foo () at manythreads.c:10
10        return NULL;
(gdb) commands 1
Type commands for when breakpoint 1 is hit, one per line.
End with a line saying just "end".
>silent
>c
>end
(gdb) c
Continuing.
[LWP    183438         exited]
[New LWP    186738        ]
procfs: fetch_registers, get_gregs line 3706, /proc/26519/lwp/183438: No such
file or directory.
(gdb) q
The program is running.  Quit anyway (and detach it)? (y or n) y
Detaching from program: /export/home/paul/tmp/a.out, process 26519
$ 
[1]+  Trace/Breakpoint Trap   (core dumped) ./a.out 40


With GDB-cvs, not all is smooth either:

./a.out 40 &
[1] 26525
$ 
$ 
$ 
$ ~/gdb-cvs/build/gdb/gdb ./a.out 26525
GNU gdb (GDB) 7.0.50.20091011-cvs
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i386-pc-solaris2.10".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /export/home/paul/tmp/a.out...done.
Attaching to program `/export/home/paul/tmp/a.out', process 26525
[New process 26525]
Retry #1:
Retry #2:
Retry #3:
Retry #4:
Reading symbols from /lib/libpthread.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib/libpthread.so.1
Reading symbols from /lib/libc.so.1...(no debugging symbols found)...done.
[Thread debugging using libthread_db enabled]
[New LWP    57697        ]
[New LWP    57681        ]
[New LWP    57678        ]
[New LWP    57698        ]
[New LWP    57690        ]
[New LWP    57644        ]
[New LWP    57703        ]
[New LWP    57708        ]
[New LWP    57711        ]
[New LWP    57640        ]
[New LWP    57652        ]
[New LWP    57653        ]
[New LWP    57662        ]
[New LWP    57663        ]
[New LWP    57672        ]
[New LWP    57692        ]
[New LWP    57707        ]
[New LWP    57685        ]
[New LWP    57704        ]
[New LWP    57673        ]
[New LWP    57661        ]
[New LWP    57683        ]
[New LWP    57686        ]
[New LWP    57674        ]
[New LWP    57712        ]
[New LWP    57717        ]
[New LWP    57675        ]
[New LWP    57650        ]
[New LWP    57695        ]
[New LWP    57651        ]
[New LWP    57684        ]
[New LWP    57706        ]
[New LWP    57658        ]
[New LWP    57647        ]
[New LWP    57680        ]
[New LWP    57699        ]
[New LWP    57718        ]
[New LWP    57669        ]
[New LWP    57642        ]
[New LWP    57657        ]
[New LWP    57659        ]
[New LWP    57641        ]
[New LWP    57719        ]
[New LWP    57649        ]
[New LWP    57710        ]
[New LWP    57682        ]
[New LWP    57702        ]
[New LWP    57667        ]
[New LWP    57670        ]
[New LWP    57679        ]
[New LWP    57688        ]
[New LWP    57696        ]
[New LWP    57689        ]
[New LWP    57705        ]
[New LWP    57713        ]
[New LWP    57654        ]
[New LWP    57666        ]
[New LWP    57648        ]
[New LWP    57664        ]
[New LWP    57714        ]
[New LWP    57701        ]
[New LWP    57645        ]
[New LWP    57656        ]
[New LWP    57716        ]
[New LWP    57671        ]
[New LWP    57676        ]
[New LWP    57715        ]
[New LWP    57668        ]
[New LWP    57655        ]
[New LWP    57691        ]
[New LWP    57646        ]
[New LWP    57665        ]
[New LWP    57694        ]
[New LWP    57687        ]
[New LWP    57643        ]
[New LWP    57660        ]
[New LWP    57677        ]
[New LWP    57709        ]
[New LWP    57700        ]
[New LWP    57693        ]
[New Thread 1 (LWP 1)]
[New Thread 57680 (LWP 57680)]
[New Thread 57681 (LWP 57681)]
[New Thread 57682 (LWP 57682)]
[New Thread 57683 (LWP 57683)]
[New Thread 57684 (LWP 57684)]
[New Thread 57685 (LWP 57685)]
[New Thread 57686 (LWP 57686)]
[New Thread 57687 (LWP 57687)]
[New Thread 57688 (LWP 57688)]
[New Thread 57689 (LWP 57689)]
[New Thread 57690 (LWP 57690)]
[New Thread 57691 (LWP 57691)]
[New Thread 57692 (LWP 57692)]
[New Thread 57693 (LWP 57693)]
[New Thread 57694 (LWP 57694)]
[New Thread 57695 (LWP 57695)]
[New Thread 57696 (LWP 57696)]
[New Thread 57697 (LWP 57697)]
[New Thread 57698 (LWP 57698)]
[New Thread 57699 (LWP 57699)]
[New Thread 57700 (LWP 57700)]
[New Thread 57701 (LWP 57701)]
[New Thread 57702 (LWP 57702)]
[New Thread 57703 (LWP 57703)]
[New Thread 57704 (LWP 57704)]
[New Thread 57705 (LWP 57705)]
[New Thread 57706 (LWP 57706)]
[New Thread 57707 (LWP 57707)]
[New Thread 57708 (LWP 57708)]
[New Thread 57709 (LWP 57709)]
[New Thread 57710 (LWP 57710)]
[New Thread 57711 (LWP 57711)]
[New Thread 57712 (LWP 57712)]
[New Thread 57713 (LWP 57713)]
[New Thread 57714 (LWP 57714)]
[New Thread 57715 (LWP 57715)]
[New Thread 57716 (LWP 57716)]
[New Thread 57717 (LWP 57717)]
[New Thread 57718 (LWP 57718)]
[New Thread 57719 (LWP 57719)]
[New Thread 57640        ]
[New Thread 57641        ]
[New Thread 57642        ]
[New Thread 57643        ]
[New Thread 57644        ]
[New Thread 57645        ]
[New Thread 57646        ]
[New Thread 57647        ]
[New Thread 57648        ]
[New Thread 57649        ]
[New Thread 57650        ]
[New Thread 57651        ]
[New Thread 57652        ]
[New Thread 57653        ]
[New Thread 57654        ]
[New Thread 57655        ]
[New Thread 57656        ]
[New Thread 57657        ]
[New Thread 57658        ]
[New Thread 57659        ]
[New Thread 57660        ]
[New Thread 57661        ]
[New Thread 57662        ]
[New Thread 57663        ]
[New Thread 57664        ]
[New Thread 57665        ]
[New Thread 57666        ]
[New Thread 57667        ]
[New Thread 57668        ]
[New Thread 57669        ]
[New Thread 57670        ]
[New Thread 57671        ]
[New Thread 57672        ]
[New Thread 57673        ]
[New Thread 57674        ]
[New Thread 57675        ]
[New Thread 57676        ]
[New Thread 57677        ]
[New Thread 57678        ]
[New Thread 57679        ]
Loaded symbols for /lib/libc.so.1
Reading symbols from /lib/ld.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib/ld.so.1
[Switching to Thread 1 (LWP 1)]
0xfef19735 in ___nanosleep () from /lib/libc.so.1
(gdb) b foo
Breakpoint 1 at 0x8050a83: file manythreads.c, line 10.
(gdb) commands 1
Type commands for when breakpoint 1 is hit, one per line.
End with a line saying just "end".
>silent
>c
>end
(gdb) c
Continuing.
[New LWP    57720        ]
[Switching to Thread 57680 (LWP 57680)]
[LWP    57680         exited]
procfs: fetch_registers, get_gregs line 3799, /proc/26525/lwp/57680: No such
file or directory.
(gdb) commands 1
Type commands for when breakpoint 1 is hit, one per line.
End with a line saying just "end".
>end
c
procfs: fetch_registers, get_gregs line 3799, /proc/26525/lwp/57680: No such
file or directory.
(gdb) c                         
Continuing.
procfs: fetch_registers, get_gregs line 3799, /proc/26525/lwp/57680: No such
file or directory.
(gdb) c
Continuing.
procfs: fetch_registers, get_gregs line 3799, /proc/26525/lwp/57680: No such
file or directory.
(gdb) q
A debugging session is active.

        Inferior 1 [process 26525    ] will be detached.

Quit anyway? (y or n) y
Detaching from program: /export/home/paul/tmp/a.out, process 26525
$ 
$ jobs
[1]+  Running                 ./a.out 40 &


-- 


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]