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

Metzger, Markus T
2013-03-06T18:08:24Z

> -----Original Message-----
> From: Jan Kratochvil [mailto:jan.kratochvil@redhat.com]
> Sent: Wednesday, March 06, 2013 6:06 PM
> To: Metzger, Markus T
> Cc: gdb-patches@sourceware.org; markus.t.metzger@gmail.com; Himpel, Christian
> Subject: Re: Crash of GDB with gdbserver btrace enabled [Re: [patch v9 00/23] branch tracing support for Atom]
>
> Hi Markus,
>
> On Wed, 06 Mar 2013 16:30:13 +0100, Metzger, Markus T wrote:
> > I still disable threads in to_close which tries to talk to the target.
>
> When one follows the Pedro's way which I forwarded to you in to_close one
> should only clear resources, without doing any actions involving the rest of
> GDB infrastructure.
>
> Do you think the attached patch still has some leaks or other issues?

I'm not quite sure what the OS will do if tracing is requested twice for the same
thread, i.e. repeated "record stop" followed by "record btrace" . We may get
an error or we may get a second buffer, thus leaking resources (i.e. the mmapped
trace buffer). We will need another target method to disable branch tracing
that is called by the "record stop" command.

In a gdbserver --multi session, I would expect that we're leaking the mmapped trace
buffer also on re-run. I think this can be handled with an appropriate
to_create_inferior method.

Thanks a lot. I'll incorporate it and send an update of the patch series tomorrow.

> An unrelated small cleanup is that btrace_disconnect should be IMO called from
> to_detach and not from detach_command.

Thanks. I already fixed that then when I investigated the issue.

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