From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28450 invoked by alias); 24 Jun 2008 17:29:50 -0000 Received: (qmail 28441 invoked by uid 22791); 24 Jun 2008 17:29:49 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 24 Jun 2008 17:29:32 +0000 Received: (qmail 3682 invoked from network); 24 Jun 2008 17:29:30 -0000 Received: from unknown (HELO orlando.local) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 24 Jun 2008 17:29:30 -0000 From: Pedro Alves To: gdb@sourceware.org, Dmitry Smirnov Subject: Re: How to catch GDB crash Date: Tue, 24 Jun 2008 17:29:00 -0000 User-Agent: KMail/1.9.9 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200806241829.29427.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-06/txt/msg00242.txt.bz2 A Tuesday 24 June 2008 18:02:49, Dmitry Smirnov wrote: > As you can see, first time > mi_on_resume is called with ptid={pid = -1, lwp = 0, tid = 0}. Something > happens between this call and second call where ptid={pid = 42000, lwp = 0, > tid = 0}. > > I'm going to figure out which command is followed by wrong pid. I'm > suspecting memory corruption. This pid is used by GDB internally when you are connected to a target that does not support threads at all, like small embedded systems. If the remote side doesn't have a notion of thread ids or pids, that magic number is what GDB will use internally. This code path can be triggered for example while stepping over a breakpoint (doing nexti / -exec-next-instruction while stopped at a breakpoint). > BTW, command 'info threads' gives me > (gdb) info threads > warning: RMT ERROR : failed to get remote thread list. ... which this seems to corroborate. This is a new bug in GDB that was introduced recently. I've already said in my last reply what needs to be done to fix it. If your target *does* support threads and the remote protocol thread related packets, than there's yet another bug somewhere else. -- Pedro Alves