RE: Crash of GDB with gdbserver btrace enabled [Re: [patch v9 00/23] branch tracing support for Atom]

Metzger, Markus T
2013-03-07T10:33:39Z

> -----Original Message-----
> From: Jan Kratochvil [mailto:jan.kratochvil@redhat.com]
> Sent: Thursday, March 07, 2013 11:14 AM

> > void
> > pop_target (void)
> > {
> > target_close (target_stack, 0); /* Let it clean up. */
> > if (unpush_target (target_stack) == 1)
> > return;
> >
> > fprintf_unfiltered (gdb_stderr,
> > "pop_target couldn't find target %s\n",
> > current_target.to_shortname);
> > internal_error (__FILE__, __LINE__,
> > _("failed internal consistency check"));
> > }
> >
> > Isn't pop_target closing the topmost target twice?
> >
> > When I remove the first call to target_close and do not turn errors into
> > warnings in record_btrace_close, the crash is gone. I have no clue about
> > the side effects of this, though.
>
>
> OK, I agree target_close seems excessive here, it also does not correspond to
> the current description of target_close:
> This routine is automatically always called after popping the target
> off the target stack
>
> While it is nice cleanup I find it a separate patch, not required for btrace.

With this patch, the crash is gone with only minimal changes to btrace.
OK to add it as separate patch to the btrace series?

Regards,
Markus.
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk
Registergericht: Muenchen HRB 47456
Ust.-IdNr./VAT Registration No.: DE129385895
Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052