public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Pierre-Marie de Rodat <derodat@adacore.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Fix use of a dangling pointer for Python breakpoint objects
Date: Mon, 27 Jun 2016 10:03:00 -0000	[thread overview]
Message-ID: <9a576973-8f7f-c8a7-81ec-b1c12c8da140@redhat.com> (raw)
In-Reply-To: <72fe08f8-6a9f-1c50-ea5a-1ce75f624e6f@adacore.com>

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

  reply	other threads:[~2016-06-27 10:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-21 10:40 Pierre-Marie de Rodat
2016-06-23 16:15 ` Pedro Alves
2016-06-24  9:21   ` Pierre-Marie de Rodat
2016-06-24 16:41     ` Pedro Alves
2016-06-27  9:11       ` Pierre-Marie de Rodat
2016-06-27 10:03         ` Pedro Alves [this message]
2016-06-27 10:13           ` Pierre-Marie de Rodat

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9a576973-8f7f-c8a7-81ec-b1c12c8da140@redhat.com \
    --to=palves@redhat.com \
    --cc=derodat@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).