From: Pedro Alves <palves@redhat.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: Jan Kratochvil <jan.kratochvil@redhat.com>,
gdb-patches@sourceware.org,
Markus Metzger <markus.t.metzger@intel.com>
Subject: Re: [patch] Fix cleanup in finish_command
Date: Thu, 20 Jun 2013 16:06:00 -0000 [thread overview]
Message-ID: <51C321AC.3030506@redhat.com> (raw)
In-Reply-To: <20130620151806.GD4724@adacore.com>
On 06/20/2013 04:18 PM, Joel Brobecker wrote:
>> BTW I have found the crash happens even with this patch, I haven't found the
>> real cause yet.
>
> Interesting, as I couldn't understand the relationship between
> the backtrace and the patch... You might also be in a situation
> similar to what I faced on Darwin: a correct cleanup fix triggering
> a latent bug; In that situation I found it useful to first git-bisect
> to narrow down the commit that caused the change of behavior, and
> then finish the bug off with valgrind's help.
Seems to be that GDB got a SIGHUP while within proceed. That
causes a "quit", which kills the inferior, and cancels it's
threads' continuations, which deletes the finish breakpoint.
From the patch, I take it the cleanup that is supposed to delete
that same finish breakpoint on error somehow ran before that,
so that the end result is that GDB ended up trashed for
trying to delete the same breakpoint twice?
The discard_cleanups is after proceed because proceed may
error too, with e.g., a QUIT, though other regular errors
may happen. I think fixing this needs a bit more work.
On error, the continuations are left stale in the thread
(try hacking an error call just before proceed, after installing
the continuation), which is wrong as it'll cause problems
for the next execution command... I think we need to move
the discard_cleanups above proceed, but, also make sure the
continuations are cancelled on error (IOW, cancel the
whole command on error). Maybe install a new cleanup
while `proceed' is running, that runs:
do_all_intermediate_continuations (1);
do_all_continuations (1);
(See inferior_event_handler.)
--
Pedro Alves
prev parent reply other threads:[~2013-06-20 15:37 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-19 21:42 Jan Kratochvil
2013-06-20 14:42 ` Jan Kratochvil
2013-06-20 15:26 ` Joel Brobecker
2013-06-20 15:37 ` Metzger, Markus T
2013-06-20 16:45 ` Jan Kratochvil
2013-06-21 8:14 ` Metzger, Markus T
2013-06-21 8:23 ` Jan Kratochvil
2013-06-21 8:25 ` Metzger, Markus T
2013-07-02 14:50 ` Metzger, Markus T
2013-06-21 12:56 ` Jan Kratochvil
2013-06-20 16:06 ` Pedro Alves [this message]
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=51C321AC.3030506@redhat.com \
--to=palves@redhat.com \
--cc=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=jan.kratochvil@redhat.com \
--cc=markus.t.metzger@intel.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