From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 53650 invoked by alias); 8 Jul 2015 18:51:06 -0000 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 Received: (qmail 53302 invoked by uid 89); 8 Jul 2015 18:51:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 08 Jul 2015 18:51:02 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 4BAE09239A; Wed, 8 Jul 2015 18:51:01 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t68IoxWE014164; Wed, 8 Jul 2015 14:51:00 -0400 Message-ID: <559D7113.5000809@redhat.com> Date: Wed, 08 Jul 2015 18:51:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Simon Marchi , gdb-patches@sourceware.org Subject: Re: [PATCH] Delete program spaces directly when removing inferiors References: <1412022790-21931-1-git-send-email-simon.marchi@ericsson.com> <559D1220.1060708@redhat.com> <559D4314.2000906@ericsson.com> <559D44FF.60705@ericsson.com> <559D48CE.5030700@redhat.com> <559D6784.9080408@ericsson.com> <559D6935.7060103@redhat.com> <559D6E89.5040709@ericsson.com> In-Reply-To: <559D6E89.5040709@ericsson.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-07/txt/msg00247.txt.bz2 On 07/08/2015 07:40 PM, Simon Marchi wrote: > On 15-07-08 02:17 PM, Pedro Alves wrote: >> Hmm, I think it'll fix a bug, actually. There should always >> be an inferior. And that deletes it. So I assume >> that after closing the monitor target, GDB crashes as soon as >> it refers to the current inferior... >> >> In the original multi-process support (~7.0), that was not the >> case -- if you were not debugging a process, there's be >> no inferior. Seems like this code has bit rotten. > > Ok, I had this intuition as well (about deleting the last inferior). > >> I guess this suggests that no one's been using these monitor >> targets for a long while? > > Or they don't mind/notice that it crashes at exit. > >>> >>> Is there any way to test that code path relatively easily on x86? >>> >> >> Don't think so. You could stick a: >> >> delete_inferior_silent (ptid_get_pid (monitor_ptid)); >> >> call in remote.c:remote_close and see what happens there though. > > I tried something similar (monitor_ptid is not available there), and > bad things happen indeed. > > I'll try to update my patch to use discard_all_inferiors, but it will > be a "theoretical" fix, since there's no way to test. The patch is preapproved. Meanwhile I sent a mail to gdb@ about deleting monitor.c and friends. Thanks, Pedro Alves