jrfonseca / drmingw

Postmortem debugging tools for MinGW.
GNU Lesser General Public License v2.1
273 stars 53 forks source link

Faulting location incorrect if executable uses ASLR. #58

Closed SteelT1 closed 2 years ago

SteelT1 commented 2 years ago

Used MSYS2 mingw32 to compile the sample program.

I noticed the AddrPC of where the crashing code occurred would not match where it's actually located. Compiling the sample program with -Wl,--disable-dynamicbase passed to the linker shows the correct AddrPC. Top is the sample program without the flag set and bottom is the sample program with the flag set. 000E50E2 004050E2 In addtion gdb shows no file and line number when setting a breakpoint and addr2line will just output ??:0.

alvinhochun commented 2 years ago

Related: https://github.com/jrfonseca/drmingw/issues/32

jrfonseca commented 2 years ago

I haven't had opportunity to reproduce this, but perhaps @alvinhochun 's https://github.com/jrfonseca/drmingw/commit/204887a883055a00cdd885b2029a399b319a7028 change fixes this.

jrfonseca commented 2 years ago

I haven't tried MSYS2, but I believe this is fixed from DrMinGW side AFAICT. I've started running tests with ASLR with 75a6349b84ad6c1a5a52c17762f49ebfc9c1a65e and nothing failed. Please reopen if issues persist.

Note that issues with MSYS2's gdb and binutils's addr2line are beyond my control.