Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Sergio Durigan Junior <sergiodj@redhat.com>
To: Tom Tromey <tom@tromey.com>
Cc: Pedro Alves <palves@redhat.com>,  Tom Tromey <tromey@adacore.com>,
	 gdb-patches@sourceware.org
Subject: Re: [PATCH] Merge handle_inferior_event and handle_inferior_event_1
Date: Mon, 25 Mar 2019 22:20:00 -0000	[thread overview]
Message-ID: <87mulia94w.fsf@redhat.com> (raw)
In-Reply-To: <87ef6uj408.fsf@tromey.com> (Tom Tromey's message of "Mon, 25 Mar	2019 10:46:47 -0600")

On Monday, March 25 2019, Tom Tromey wrote:

>>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:
>
> Pedro> So it looks like your patch made it so that the value in question
> Pedro> avoids the crash because the value in question is no longer in the
> Pedro> all_values vector by the time gdb is tearing down?
>
> Makes sense.

Thanks Pedro for the explanation.  Yeah, after investigating it became
clear to me that the patch fixes (or "fixes") the bug by destroying the
value instances before we exit GDB.

What's interesting is the fact that I cannot seem to reproduce easily.
For example, if you print anything other than an xmethod, and then you
print an xmethod, and then exit GDB, everything works correctly.  For
that reason, I'm still not able to write a testcase for it, because our
testing infrastructure prints some stuff as a preparation for the test.

> Pedro> Open questions then would be:
>
> Pedro>  - what was the exception in question that was thrown from
> Pedro>    within handle_inferior_event_1?  (And if there was
> Pedro>    no exception, then the theory above is incorrect.)
>
> Pedro>  - why don't non-temporary xmethod values put in the value history
> Pedro>    cause a similar crash at tear down time?
>
> Also, if a crash can occur during value destruction like this, then I
> think it must indicate a bug somewhere else, like invalid reference
> counting somewhere.

That's a good point, yeah.  I can try investigating more.

Having said that, I think the patch is simple enough to be safely
backportable to 8.3, and it doesn't really break anything (in fact, as
Pedro mentioned, it makes things more correct, because now we're sure
that we will destroy the objects if an exception is thrown), so IMHO
there's no downside to it.  WDYT?

Thanks,

-- 
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF  31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/


  reply	other threads:[~2019-03-25 22:20 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190320140846.13031-1-tromey@adacore.com>
2019-03-20 16:21 ` Pedro Alves
2019-03-21 22:05 ` Sergio Durigan Junior
2019-03-22  0:01   ` Sergio Durigan Junior
2019-03-25 15:35     ` Tom Tromey
2019-03-25 16:34       ` Pedro Alves
2019-03-25 16:46         ` Tom Tromey
2019-03-25 22:20           ` Sergio Durigan Junior [this message]
2019-03-26 13:13             ` Tom Tromey
2019-03-26 16:07               ` Sergio Durigan Junior
2019-03-26 18:45                 ` Tom Tromey
2019-03-26 21:50                 ` Sergio Durigan Junior
2019-03-27 12:57                   ` Tom Tromey
2019-03-28 14:12                     ` Pedro Alves
2019-03-29 21:44                       ` [PATCH] Destroy allocated values when exiting GDB (was: Re: [PATCH] Merge handle_inferior_event and handle_inferior_event_1) Sergio Durigan Junior
2019-04-01 14:08                         ` [PATCH] Destroy allocated values when exiting GDB Pedro Alves
2019-04-01 14:59                           ` Sergio Durigan Junior

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=87mulia94w.fsf@redhat.com \
    --to=sergiodj@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    --cc=tom@tromey.com \
    --cc=tromey@adacore.com \
    /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