From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28574 invoked by alias); 28 Mar 2005 22:54:39 -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 28531 invoked from network); 28 Mar 2005 22:54:29 -0000 Received: from unknown (HELO lakermmtao08.cox.net) (68.230.240.31) by sourceware.org with SMTP; 28 Mar 2005 22:54:29 -0000 Received: from white ([68.9.64.121]) by lakermmtao08.cox.net (InterMail vM.6.01.04.00 201-2131-118-20041027) with ESMTP id <20050328225423.IRUZ18351.lakermmtao08.cox.net@white> for ; Mon, 28 Mar 2005 17:54:23 -0500 Received: from bob by white with local (Exim 3.35 #1 (Debian)) id 1DG42g-0000yN-00 for ; Mon, 28 Mar 2005 18:53:10 -0500 Date: Mon, 28 Mar 2005 22:54:00 -0000 From: Bob Rossi To: GDB Subject: Re: [mi] watchpoint-scope exec async command Message-ID: <20050328235310.GA3699@white> Mail-Followup-To: GDB References: <20050325161239.GA12231@white> <01c53207$Blat.v2.4$3def9b00@zahav.net.il> <20050328225619.GB3413@white> <20050328224101.GA629@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050328224101.GA629@nevyn.them.org> User-Agent: Mutt/1.3.28i X-SW-Source: 2005-03/txt/msg00264.txt.bz2 On Mon, Mar 28, 2005 at 05:41:01PM -0500, Daniel Jacobowitz wrote: > On Mon, Mar 28, 2005 at 05:56:19PM -0500, Bob Rossi wrote: > > (gdb) n > > Hardware watchpoint 2 deleted because the program has left the block > > in which its expression is valid. > > Segmentation fault > > > > The crash only happens sometimes. Although when I run it over and over, > > I will eventually get it. > > > > Here is the problem I found, > > > > (gdb) n > > Hardware watchpoint 2 deleted because the program has left the block > > in which its expression is valid. > > ==26644== Invalid write of size 4 > > ==26644== at 0x80D9B32: insert_bp_location (breakpoint.c:1022) > > ==26644== by 0x80D9EDA: insert_breakpoints (breakpoint.c:1151) > > ==26644== by 0x8119620: proceed (infrun.c:774) > > I envy you. I can't get valgrind to work with GDB; once I try to run a > child process, it falls over. Yeah, I was thinking I could script valgrind through the GDB testsuite, and report any memory leaks/memory corruption. This would probably be a big task though ... > > So, basically, I can't figure out why the breakpoint field > > 'related_breakpoint' became in valid. I believe it was valid when the > > breakpoint was created, since the memset is there. However, at some > > point, it must have become invalid ... > > The related breakpoint is supposed to be the scope breakpoint; I can't > see how they could become unpaired. You may want to run a debugger on > GDB, using a watchpoint to see what changes it? I've tried this, GDB didn't seem to think anyone access'd b->related_breakpoint between the time it was set in watch_command_1 to the time that valgrind gives the error in insert_bp_location. My hunch is that b->related_breakpoint's memory was free'd and never set to NULL. Is this possible? I don't think a watchpoint would pick that up, would it? Any other ideas? I've been debugging, but since I don't have a high level overview of the data structures, I'm a little handicapped. Bob Rossi