This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RE: [PATCH v2 3/3] btrace, frame: fix crash in get_frame_type
- From: "Metzger, Markus T" <markus dot t dot metzger at intel dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Thu, 11 Feb 2016 09:51:26 +0000
- Subject: RE: [PATCH v2 3/3] btrace, frame: fix crash in get_frame_type
- Authentication-results: sourceware.org; auth=none
- References: <1454681922-2228-1-git-send-email-markus dot t dot metzger at intel dot com> <1454681922-2228-3-git-send-email-markus dot t dot metzger at intel dot com> <56B9D620 dot 2020104 at redhat dot com> <A78C989F6D9628469189715575E55B233325FC44 at IRSMSX104 dot ger dot corp dot intel dot com> <56BA61C6 dot 8060807 at redhat dot com> <A78C989F6D9628469189715575E55B233325FF30 at IRSMSX104 dot ger dot corp dot intel dot com> <56BB0A0D dot 80502 at redhat dot com> <A78C989F6D9628469189715575E55B233325FFC6 at IRSMSX104 dot ger dot corp dot intel dot com> <A78C989F6D9628469189715575E55B233326016F at IRSMSX104 dot ger dot corp dot intel dot com> <56BB5872 dot 2000604 at redhat dot com>
> -----Original Message-----
> From: Pedro Alves [mailto:palves@redhat.com]
> Sent: Wednesday, February 10, 2016 4:34 PM
> To: Metzger, Markus T <markus.t.metzger@intel.com>
> Cc: gdb-patches@sourceware.org
> Subject: Re: [PATCH v2 3/3] btrace, frame: fix crash in get_frame_type
>
> On 02/10/2016 03:02 PM, Metzger, Markus T wrote:
>
> > No new fails there, as well (64-bit IA).
> >
> > I added a comment based on your statement that
> frame_unwind_caller_xxx
> > callers should check frame_unwind_caller_id and assert that
> > skip_artificial_frames does not return NULL.
> >
> > Info frame doesn't crash.
> >
> > (gdb) info frame
> > Stack level 0, frame at 0x0:
> > rip = 0x4005b0 in bar (tailcall-only.c:29); saved rip = 0x4005c2
> > called by frame at 0x0
> ^^^^^^^^^^^^^^^
>
> > source language c.
> > Arglist at unknown address.
> > Locals at unknown address,Registers are not available in btrace
> > record history
> >
> > This is from a tailcall-only frame stack in replay mode using the tailcall-only
> test.
> > The real caller has not been recorded.
>
> Not sure how you got that, since "called by frame" seems to indicates that
> the frame was not TAILCALL_FRAME:
That's the sentinel frame. I forgot to "up". Now it crashes;-)
There are other cases where frame_unwind_caller_xxx callers don't check
frame_unwind_caller_id:
gdb/mips-linux-tdep.c
gdb/glibc-tdep.c
gdb/obsd-tdep.c
gdb/tic6x-linux-tdep.c
gdb/sol2-tdep.c
gdb/nios2-linux-tdep.c
They're used for skipping syscalls and ld.so.
The latter should be called via gdbarch_skip_solib_resolver (gdbarch, stop_pc)
from infrun.c.
Who is supposed to do the check in those cases? Maybe they are already OK?
Regards,
Markus.
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928