Fix crash backtraces on MS-Windows, broken by ASLR
authorEli Zaretskii <eliz@gnu.org>
Fri, 26 Jan 2024 13:01:51 +0000 (15:01 +0200)
committerEli Zaretskii <eliz@gnu.org>
Fri, 26 Jan 2024 13:01:51 +0000 (15:01 +0200)
commitde020255a5cef4349d786fceb19481352c49557b
tree983b2f255dbdeeb4c3c302adcf7f92ea77c6b75b
parent723b0973512c0e6e9fb0f07678124347ccd44b54
Fix crash backtraces on MS-Windows, broken by ASLR

* src/w32fns.c (DEFAULT_IMAGE_BASE): Define for 64-bit and 32-bit
MinGW builds.
(emacs_abort): Correct the callstack addresses for potential
relocation of the image base due to ASLR.  This makes 'addr2line'
be able to interpret emacs_backtrace.txt when ASLR is in effect,
which it is on every modern version of MS-Windows.  (Bug#63365)

* configure.ac (LD_SWITCH_SYSTEM_TEMACS) [mingw32]: Add comment
about keeping the image-base values in sync with w32fns.c.

* etc/DEBUG (How to disable ASLR): New section.
configure.ac
etc/DEBUG
src/w32fns.c