This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Fix cleanup in finish_command


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]