From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 116776 invoked by alias); 10 Aug 2016 22:11:00 -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 116722 invoked by uid 89); 10 Aug 2016 22:10:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Simplify, PRMS, prms, 1720 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, 10 Aug 2016 22:10:51 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 892D461E5E for ; Wed, 10 Aug 2016 22:10:50 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u7AMAnVg026168 for ; Wed, 10 Aug 2016 18:10:50 -0400 Subject: Re: [PATCH 0/4] Fix PR gdb/19187 (process record over a fork causes internal error) To: gdb-patches@sourceware.org References: <1455475070-17797-1-git-send-email-palves@redhat.com> From: Pedro Alves Message-ID: Date: Wed, 10 Aug 2016 22:11:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <1455475070-17797-1-git-send-email-palves@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-08/txt/msg00125.txt.bz2 Yao reminded me about this series, and asked about putting it in 7.12. I've done so now: pushed to master and 7.12 branch. Thanks, Pedro Alves On 02/14/2016 06:37 PM, Pedro Alves wrote: > This series fixes: > > (gdb) record > break marker2 > Breakpoint 2 at 0x40067a: file /home/pedro/gdb/mygit/src/gdb/testsuite/gdb.reverse/waitpid-reverse.c, line 30. > (gdb) PASS: gdb.reverse/waitpid-reverse.exp: set breakpoint at marker2 > continue > Continuing. > /home/pedro/gdb/mygit/src/gdb/record-full.c:1720: internal-error: record_full_remove_breakpoint: removing unknown breakpoint > A problem internal to GDB has been detected, > further debugging may prove unreliable. > Quit this debugging session? (y or n) > KFAIL: gdb.reverse/waitpid-reverse.exp: continue to breakpoint: marker2 (GDB internal error) (PRMS: gdb/19187) > > The problem is that the target side can't distinguish between deleting > a breakpoint and detaching a breakpoint. > > Right after a fork is detected, we detach breakpoints from the child > (detach_breakpoints), which calls into target_remove_breakpoint with > inferior_ptid pointing at the child process, but leaves the breakpoint > marked inserted (in the parent). > > Since record-full.c's target_remove_breakpoint implementation doesn't > know we're detaching a breakpoint, it removes the breakpoint from its > own breakpoint table. > > Then when we later remove the breakpoint from the parent, we fail that > assertion, since the breakpoint is unexpectedly not found in the > record-full.c breakpoint table. > > The first three patches pass down the reason for removing the > breakpoint all the way to the target. > > Patch 4 then simply makes record-full.c not delete the breakpoint from > its breakpoint table when we're detaching the breakpoint from a fork > child. > > Pedro Alves (4): > Simplify remove_breakpoint interface > Introduce 'enum remove_bp_reason' > Plumb enum remove_bp_reason all the way to target_remove_breakpoint > Fix PR gdb/19187 (process record over a fork causes internal error) > > gdb/break-catch-sig.c | 3 +- > gdb/break-catch-syscall.c | 2 +- > gdb/breakpoint.c | 70 +++++++++++++-------------- > gdb/breakpoint.h | 14 +++++- > gdb/corelow.c | 10 +++- > gdb/exec.c | 10 +++- > gdb/mem-break.c | 3 +- > gdb/record-btrace.c | 6 ++- > gdb/record-full.c | 15 ++++-- > gdb/remote.c | 5 +- > gdb/target-debug.h | 2 + > gdb/target-delegates.c | 10 ++-- > gdb/target.c | 5 +- > gdb/target.h | 9 ++-- > gdb/testsuite/gdb.reverse/waitpid-reverse.exp | 4 +- > 15 files changed, 105 insertions(+), 63 deletions(-) >