From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19708 invoked by alias); 7 Jun 2010 18:28:34 -0000 Received: (qmail 19692 invoked by uid 22791); 7 Jun 2010 18:28:33 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 07 Jun 2010 18:28:25 +0000 Received: (qmail 2512 invoked from network); 7 Jun 2010 18:28:24 -0000 Received: from unknown (HELO orlando.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 7 Jun 2010 18:28:24 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [RFA] fix crasher on detach command Date: Mon, 07 Jun 2010 18:28:00 -0000 User-Agent: KMail/1.13.2 (Linux/2.6.32-22-generic; KDE/4.4.2; x86_64; ; ) Cc: Michael Snyder References: <4C0D3636.8040206@vmware.com> In-Reply-To: <4C0D3636.8040206@vmware.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201006071928.19374.pedro@codesourcery.com> 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/msg00181.txt.bz2 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? What's the backtrace like at the time of the crash? I assume the remove_breakpoints_pid call is coming from within target_detach? > > The patch just adds a test for NULL. > > -- Pedro Alves