From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10913 invoked by alias); 10 May 2013 16:39:58 -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 10903 invoked by uid 89); 10 May 2013 16:39:57 -0000 X-Spam-SWARE-Status: No, score=-4.6 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.1 Received: from mail-ve0-f172.google.com (HELO mail-ve0-f172.google.com) (209.85.128.172) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Fri, 10 May 2013 16:39:56 +0000 Received: by mail-ve0-f172.google.com with SMTP id b10so4142701vea.3 for ; Fri, 10 May 2013 09:39:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:x-gm-message-state; bh=Aqr0oOWAPA8vNZvkG5kCn6sEC6DpjQrZXl8SkX5EPPA=; b=mP68L0LRoHZtdaXSxwrTbthbj4gnKgv70nJmhR4r0eJw9jQ1Ur3a7j3iZ7RoxaXERl eVyGa8E2lA8fqBJkjiv1IYWYW+HMNWG9EPAbFMDd5bO2DnXyVlPwamCusiRifd3RPvYk nvI6sp/Sy9krxv8YDEUAlE02OtLZqiNaH1bk6+19MuLACnfSaJ1d++0F3tsf4J8WFQ4d VON3pijd0JaHJT2z2/Evr/3ghZ9amVYscQ5M5WxAczCcXX63RerqnP6v1bIe643I8AGx ndHjbFtF2AEDWESMq24p1YHhGPFbS1lI5G55hglgSXxnQcr31EVGj1cbueZ5VB7Otx/Q uJvg== MIME-Version: 1.0 X-Received: by 10.52.183.170 with SMTP id en10mr10040522vdc.5.1368203994846; Fri, 10 May 2013 09:39:54 -0700 (PDT) Received: by 10.220.54.75 with HTTP; Fri, 10 May 2013 09:39:54 -0700 (PDT) In-Reply-To: <1368136582.30058.7.camel@soleil> References: <1368136582.30058.7.camel@soleil> Date: Fri, 10 May 2013 16:39:00 -0000 Message-ID: Subject: Re: RFA: fix gdb_assert caused by 'catch signal ...' and fork From: Doug Evans To: Philippe Waroquiers Cc: gdb-patches Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQlltU3kNoDQNoqt1JyOJR1ISSQKnnHQ9FcRwGW067p1u+u8lH6duU02zFkBz3BG+rw141wtgPmjagv8kFQyL8ORA03Jy+ldbcNE+baQxYsO9u2j4KrUrK4mdmQYs5z68gC9q+O9TBLFsFu5dE90X5E9mDmJeSaBsqPTpsE+ylCXxtpxh5bq7sutsHUuTMlTRr+2zoyVpmCtq+KcKGOSMay4lmSRPw== X-SW-Source: 2013-05/txt/msg00392.txt.bz2 On Thu, May 9, 2013 at 2:56 PM, Philippe Waroquiers wrote: > The attached patch fixes a gdb_assert caused by the combination of catch > signal and fork: > break-catch-sig.c:152: internal-error: signal_catchpoint_remove_location: Assertion `signal_catch_counts[iter] > 0' failed. > > The problem is that the signal_catch_counts is decremented by detach_breakpoints. > The fix consists in not detaching breakpoint locations of type bp_loc_other. > The patch introduces a new test. > > Ok to commit ? > > Index: gdb/ChangeLog > =================================================================== > RCS file: /cvs/src/src/gdb/ChangeLog,v > retrieving revision 1.15539 > diff -u -p -r1.15539 ChangeLog > --- gdb/ChangeLog 9 May 2013 18:03:27 -0000 1.15539 > +++ gdb/ChangeLog 9 May 2013 21:46:32 -0000 > @@ -1,3 +1,8 @@ > +2013-05-09 Philippe Waroquiers > + > + * breakpoints.c (detach_breakpoints): Do not > + detach breakpoints locations with loc_type bp_loc_other. > + > 2013-05-09 Doug Evans > > * symfile.c (syms_from_objfile_1): Delete args offsets, num_offsets. > Index: gdb/breakpoint.c > =================================================================== > RCS file: /cvs/src/src/gdb/breakpoint.c,v > retrieving revision 1.761 > diff -u -p -r1.761 breakpoint.c > --- gdb/breakpoint.c 7 May 2013 17:04:28 -0000 1.761 > +++ gdb/breakpoint.c 9 May 2013 21:46:33 -0000 > @@ -3537,6 +3537,9 @@ detach_breakpoints (ptid_t ptid) > if (bl->pspace != inf->pspace) > continue; > > + if (bl->loc_type == bp_loc_other) > + continue; > + > if (bl->inserted) > val |= remove_breakpoint_1 (bl, mark_inserted); > } I think a comment is required here explaining *why* we continue for bp_loc_other. [Assuming the patch is correct ...] However, there's nothing in "bp_loc_other" that says we should always continue there. Other breakpoint kinds are marked bp_loc_other too. Plus avoiding calling remove_breakpoint_1 feels like working around the problem. This doesn't feel like the right fix.