From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20186 invoked by alias); 19 Apr 2007 04:41:47 -0000 Received: (qmail 20178 invoked by uid 22791); 19 Apr 2007 04:41:46 -0000 X-Spam-Check-By: sourceware.org Received: from pool-72-70-61-13.bstnma.fios.verizon.net (HELO cgf.cx) (72.70.61.13) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 19 Apr 2007 05:41:41 +0100 Received: by cgf.cx (Postfix, from userid 201) id 91E6113C0AC; Thu, 19 Apr 2007 00:41:39 -0400 (EDT) Date: Thu, 19 Apr 2007 12:20:00 -0000 From: Christopher Faylor To: Pedro Alves , gdb-patches@sourceware.org Subject: Re: [Cygwin] Fix for: detaching crashes the inferior. Message-ID: <20070419044139.GA24029@trixie.casa.cgf.cx> Mail-Followup-To: Pedro Alves , gdb-patches@sourceware.org References: <4618D3F7.3040700@portugalmail.pt> <4619748C.5080007@portugalmail.pt> <46199F9C.1060803@portugalmail.pt> <20070410051535.GA11134@ednor.casa.cgf.cx> <4053daab0704100345x5eee0dcav7104180ad93e5750@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4053daab0704100345x5eee0dcav7104180ad93e5750@mail.gmail.com> User-Agent: Mutt/1.5.11 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-04/txt/msg00290.txt.bz2 On Tue, Apr 10, 2007 at 11:45:39AM +0100, Pedro Alves wrote: >On 4/10/07, Christopher Faylor wrote: > >>Are you sure you aren't seeing problems when you attach/detach more than >>once? I know that there is someplace that isn't getting cleared in that >>scenario. I have thought that I fixed that problem a few times but it >>still seems to be there in the latest cygwin release. >> > >I tried that many times, with the following test program: > >$ cat main.c >#include >#include > >int >main(int argc, char** argv) >{ > int count = 0; > while (1) > { > printf ("count = %d\n", count++); > fflush (stdout); > Sleep (1000); > } >} > >I attached with gdb --pid , set a break on line 9, continue, >breakpoint is hit, hit next a couple of times, detach, reattach without >restarting gdb, continue till the breakpoint, step a couple times, >remove breakpoint, detach, restart gdb, attach, do the same, but >letting gdb start the inferior as a child, redo the testing a couple of >times, and nothing bad happens... I'm not necessarily talking about attaching and restarting the same program multiple times. I don't know the exact scenario when I see the problem (or I probably would have fixed it) but I think it is possibly when attaching after doing a normal "gdb program" or maybe just killing and rerunning after attaching. Like I said, I don't know for sure but I wasn't asking you to fix the problem. Go ahead and check in what you've got. cgf