From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10369 invoked by alias); 10 Oct 2011 23:30:22 -0000 Received: (qmail 10341 invoked by uid 22791); 10 Oct 2011 23:30:21 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO sourceware.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 10 Oct 2011 23:30:03 +0000 From: "ctice42 at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug server/13279] New: gdbserver hangs (multi-threaded) if stepping on one thread & another thread gets SIGPROF Date: Mon, 10 Oct 2011 23:30:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: server X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ctice42 at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org X-SW-Source: 2011-q4/txt/msg00054.txt.bz2 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.