From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15834 invoked by alias); 27 Jun 2016 10:03:59 -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 15817 invoked by uid 89); 27 Jun 2016 10:03:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=HX-Greylist:sk:milter-, HX-Greylist:Jun, HX-Greylist:Mon, HX-Greylist:2016 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; Mon, 27 Jun 2016 10:03:48 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (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 3A9657F342; Mon, 27 Jun 2016 10:03:47 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u5RA3jEW016308; Mon, 27 Jun 2016 06:03:46 -0400 Subject: Re: [PATCH] Fix use of a dangling pointer for Python breakpoint objects To: Pierre-Marie de Rodat , gdb-patches@sourceware.org References: <20160621104021.15093-1-derodat@adacore.com> <02138a22-5087-44ad-6023-7c87251f3d19@redhat.com> <72fe08f8-6a9f-1c50-ea5a-1ce75f624e6f@adacore.com> From: Pedro Alves Message-ID: <9a576973-8f7f-c8a7-81ec-b1c12c8da140@redhat.com> Date: Mon, 27 Jun 2016 10:03: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: <72fe08f8-6a9f-1c50-ea5a-1ce75f624e6f@adacore.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-06/txt/msg00422.txt.bz2 On 06/27/2016 10:11 AM, Pierre-Marie de Rodat wrote: > +gdb_test "source py-breakpoint2.py" This is still sourcing the old filename. > + > +# ... and when it did, as a result, the following breakpoint creation (not > +# initiated by the Python API) would dereference the already-freed Python > +# breakpoint wrapper, resulting in undefined behavior, sometimes observed as a > +# gdb crash, and other times causing the next stop to invoke the Python wrapper > +# "stop" method for the object that is not supposed to exist. > +gdb_test "break foo" > + > +# ... eventually, triggering this breakpoint will invoke the Python wrapper > +# "stop" method for an object that is not supposed to exist. Remove this sentence, it no longer makes sense to have it. > +set test "continuing to foo" > +gdb_test_multiple "continue" "$test" { > + -re "MyBP\.stop was invoked\!.*$gdb_prompt $" { > + fail "$test" > + } > + -re "Continuing.*Breakpoint 2, foo.*$gdb_prompt $" { > + pass "$test" > + } > +} OK with the above fixed. Thanks, Pedro Alves