Subject: Re: bug#63365: 30.0.50; GCC 13.1 breaks building Emacs with native-compilation

From: Eli Zaretskii <[email-masked]>
Date: Thu, 11 May 2023 13:06:15 +0300

> Cc: [email-masked], [email-masked]
> Date: Wed, 10 May 2023 22:08:57 +0300
> From: Eli Zaretskii <[email-masked]>
> 
> > Cc: [email-masked], [email-masked]
> > Date: Wed, 10 May 2023 19:54:06 +0300
> > From: Eli Zaretskii <[email-masked]>
> > 
> > Maybe it's a bug in your addr2line, then.  It works perfectly here,
> > FWIW.
> > 
> > Can you make the unstripped emacs.exe available for download
> > somewhere, along with the emacs_backtrace.txt produced by that same
> > binary?  I'd like to take a look.
> 
> Hmm... looking at the files you sent, I'm beginning to think something
> is wrong with generating backtraces on MS-Windows in the 64-bit
> builds.  Maybe it has to do with ASLR, or maybe the code which
> produces the backtrace is wrong in 64-bit executables.

Actually, I take this back: the addresses in emacs_backtrace.txt seem
reasonable, similar to addresses shown in GDB backtraces from a 64-bit
Windows build we have on the bug tracker.

So the suspicion goes back to addr2line, although I see the same
problem with my version, which I built myself and which works
flawlessly with the 32-bit MinGW build of Emacs.

> I'd like to see the backtrace from GDB and compare the addresses there
> with those in emacs_backtrace.txt.  Did you try to run the crashing
> command under GDB, as I described earlier?

And also, please try the other method described in the manual:

  The hexadecimal numbers are program addresses, which can be
  associated with source code lines using a debugging tool.  For
  example, the GDB command ‘list *0x509af6’ prints the source-code
  lines corresponding to the ‘emacs[0x509af6]’ entry.

So could you try this method with a couple of addresses shown in
emacs_backtrace.txt you have?  Does "list *0xNNNNN" yield reasonable
source locations?