From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8546 invoked by alias); 7 Jun 2010 19:00:13 -0000 Received: (qmail 8534 invoked by uid 22791); 7 Jun 2010 19:00:12 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-outbound-2.vmware.com (HELO smtp-outbound-2.vmware.com) (65.115.85.73) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 07 Jun 2010 19:00:06 +0000 Received: from jupiter.vmware.com (mailhost5.vmware.com [10.16.68.131]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id 3061F30003; Mon, 7 Jun 2010 12:00:05 -0700 (PDT) Received: from msnyder-server.eng.vmware.com (promd-2s-dhcp138.eng.vmware.com [10.20.124.138]) by jupiter.vmware.com (Postfix) with ESMTP id 2475FDC14F; Mon, 7 Jun 2010 12:00:05 -0700 (PDT) Message-ID: <4C0D41B4.3020008@vmware.com> Date: Mon, 07 Jun 2010 19:00:00 -0000 From: Michael Snyder User-Agent: Thunderbird 2.0.0.22 (X11/20090609) MIME-Version: 1.0 To: Pedro Alves CC: "gdb-patches@sourceware.org" Subject: Re: [RFA] fix crasher on detach command References: <4C0D3636.8040206@vmware.com> <201006071928.19374.pedro@codesourcery.com> <4C0D3AFE.9020400@vmware.com> <201006071937.41182.pedro@codesourcery.com> In-Reply-To: <201006071937.41182.pedro@codesourcery.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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: 2010-06/txt/msg00185.txt.bz2 Pedro Alves wrote: > On Monday 07 June 2010 19:31:26, Michael Snyder wrote: >> Pedro Alves wrote: >>> On Monday 07 June 2010 19:11:02, Michael Snyder wrote: >>>> Hi, >>>> >>>> The circumstances are, detach from a remote target that doesn't have >>>> threads. Remote.c leaves the PID arbitrarily as "42000", and >>>> target_detach calls remove_breakpoints_pid, which crashes because >>>> find_inferior_pid returns NULL. >>> It shouldn't matter that the PID is arbitrary; there should be an >>> inferior with that PID in the inferior list. This probably means >>> that the inferior got its PID cleared to 0 already when you get here? >>> How? >> It was a bad connect, which aborted part way through. >> So yes, we're in an inconsistent internal state. > > Then we need to fix that, instead of adding workarounds in other > areas. I'm not sure how feasible that is. At this point I've had to use a ^C^C to get out of a failing attach (target remote), and I'm hoping to use the "detach" to cancel out any remaining inconsistent state. The ^C^C handler can't necessarily do it by itself, 'cause from its point of view, you don't really know what state you're in or what state you want to be in.