This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug server/13279] New: gdbserver hangs (multi-threaded) if steppingon one thread & another thread gets SIGPROF
- From: "ctice42 at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Mon, 10 Oct 2011 23:29:44 +0000
- Subject: [Bug server/13279] New: gdbserver hangs (multi-threaded) if steppingon one thread & another thread gets SIGPROF
- Auto-submitted: auto-generated
http://sourceware.org/bugzilla/show_bug.cgi?id=13279
Bug #: 13279
Summary: gdbserver hangs (multi-threaded) if stepping on one
thread & another thread gets SIGPROF
Product: gdb
Version: HEAD
Status: NEW
Severity: normal
Priority: P2
Component: server
AssignedTo: unassigned@sourceware.org
ReportedBy: ctice42@gmail.com
Classification: Unclassified
Created attachment 5973
--> http://sourceware.org/bugzilla/attachment.cgi?id=5973
test program to generate multiple threads that get lots of SIGPROFs.
Running gdbserver on a multi-threaded process, whose threads receive lots of
SIGPROF signals, gdbserver hangs while single-stepping if a SIGPROF comes in
during the single-step. This is on Linux, using current ToT gdb.
To reproduce this:
1. compile the attached test program:
gcc -g -lpthread -lm -Wall thread-signal-test.c
2. start gdbserver on the result:
gdbserver :1234 a.out
3. start gdb & connect to gdbserver:
gdb
(gdb) file a.out
(gdb) target remote :1234
4. Set a breakpoint in 'foo' and continue:
(gdb) b foo
(gdb) c
5. Do a 'next':
(gdb) n
6. Hold down the 'enter' key to get many repeated 'nexts' quickly.
Result: gdbserver will hang within 10-20 'next's (sometimes a few more,
sometimes a few less).
>From examining the gdbserver code, it appears that all the threads get stopped
in order to do the single-step; while preparing to do the single-step a SIGPROF
comes in on one of the other threads, in handling the SIGPROF, gdb forgets it
was in the middle of the single-step, and the single-step never gets finished
and the threads never get resumed.
I'm not very familiar with this code so I would appreciate it if someone who is
would take a look at this.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.