Need help with understanding truncated and corrupted backtraces
Eli Zaretskii
eliz@gnu.org
Thu Mar 25 10:04:29 GMT 2021
> From: Simon Marchi <simon.marchi@polymtl.ca>
> Date: Wed, 24 Mar 2021 18:48:18 -0400
>
> First, you could try to enable "set debug frame 1" before backtracing,
> It will show information about each frame unwind, in between each frame.
> In particular, you should see the reason why unwinding the last shown
> frame didn't yield any more frame.
Thanks, I did that, but how do I tell what is the reason for not
showing more frames? This setting spews gobs of information, and I
don't know what should I look for.
> > Thread 1 hit Breakpoint 3, Fskip_chars_backward (
> > string=XIL(0x80000000068bc060), lim=XIL(0)) at syntax.c:1610
> > 1610 return skip_chars (0, string, lim, 1);
> > (gdb) bt
> > #0 Fskip_chars_backward (string=XIL(0x80000000068bc060), lim=XIL(0))
> > at syntax.c:1610
> > #1 0x09977f08 in ?? ()
> > #2 0x01260359 in Ffuncall (nargs=1, args=0x828880) at eval.c:3009
> > #3 0x099685bb in ?? ()
> > #4 0x00000000 in ?? ()
> >
>
> >From these backtraces, what I notice is that you have debug info for the
> code written in C, such as Ffuncall: we see the argument values.
Yes. Emacs is compiled with -gdwarf-4 (and if you are wondering about
those XIL(..) things, you will find a custom Python printer in
src/.gdbinit in the Emacs sources).
> But the code coming from the JIT (in eln files) doesn't appear to have
> debug info: we don't see any argument values. Perhaps that's expected
> for JIT code, I don't know.
Yes, currently the native-compiled code doesn't have any debug info.
I'm thinking of perhaps changing that.
> Once you know which unwinder is selected for each frame, you can try to
> find starting at which unwind things went wrong and focus on that one.
>
> And if this is indeed what is happening to you (the heuristic unwinder
> gets things wrong), I see two choices:
>
> - make the JIT producer generate DWARF info for the JIT-ed code, which
> will make GDB use the DWARF-based unwinder
> - improve the heuristic-based unwinder
Let me know if you'd like to see the info emitted by "debug frame 1".
More information about the Gdb-patches
mailing list