From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1347 invoked by alias); 18 Jun 2003 00:33:24 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 1338 invoked from network); 18 Jun 2003 00:33:24 -0000 Received: from unknown (HELO crack.them.org) (146.82.138.56) by sources.redhat.com with SMTP; 18 Jun 2003 00:33:24 -0000 Received: from dsl093-172-017.pit1.dsl.speakeasy.net ([66.93.172.17] helo=nevyn.them.org ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 19SQtt-0006KG-00; Tue, 17 Jun 2003 19:34:09 -0500 Received: from drow by nevyn.them.org with local (Exim 3.36 #1 (Debian)) id 19SQsy-0002jD-00; Tue, 17 Jun 2003 20:33:12 -0400 Date: Wed, 18 Jun 2003 00:33:00 -0000 From: Daniel Jacobowitz To: imburton@micron.com Cc: gdb@sources.redhat.com Subject: Re: Multithreaded remote debug question Message-ID: <20030618003312.GA10468@nevyn.them.org> Mail-Followup-To: imburton@micron.com, gdb@sources.redhat.com References: <7F2D15533C60B44AAB75B586A3773FF10CF86B@ntxboimbx04.micron.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7F2D15533C60B44AAB75B586A3773FF10CF86B@ntxboimbx04.micron.com> User-Agent: Mutt/1.5.1i X-SW-Source: 2003-06/txt/msg00366.txt.bz2 On Tue, Jun 17, 2003 at 05:36:43PM -0600, imburton@micron.com wrote: > Daniel, > > My case that crashes is too complex to send, but I > built a much smaller case the exhibits some of the same > problems. > > Here is the source: > > #include > #include > > void* TH(void*); > > int main() > { > pthread_t tid; > int ret; > ret = pthread_create(&tid, NULL, TH, NULL); > > for (int i=0; i < 1000; i++) > { > usleep(10000); > } > } > > void *TH(void* nothing) > { > int i=100; > while( i) > { > i--; > } > return 0; > } > > > > > When I run, I set a breakpoint on line 21, the > while(i) loop in TH(). I step past it and I get a > SIGTRAP in the main thread. I switch back to the second > thread and step again, and I get another SIGTRAP. I go > back to the second thread, and step once more and the > application doesn't come back. In my real application > I get a SIGSEGV at this point instead of hanging. OK, with this use of the "thread" command to switch threads this is almost certainly the issue that required a protocol change. I'm working through my laundry list of GDB 6.0 issues right now; I'll try to get to that one. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer