RudjiGames / MTuner

MTuner is a C/C++ memory profiler and memory leak finder for Windows, PlayStation 4 and 3, Android and other platforms
BSD 2-Clause "Simplified" License
2.63k stars 145 forks source link

GCC symbol resolution fails using recent mingw-64/gcc with ASLR #83

Open merovingien opened 1 year ago

merovingien commented 1 year ago

Hello,

I try to profile and analyse a program compiled with gcc 11.2 from MSys2 project, and in all my tests I get a stack but functions, source files and lines are missing (Unknown).

I think that it may be caused by ASLR that is now enabled in all recent gcc / mingw64 releases. (https://www.msys2.org/news/#2021-01-31-aslr-enabled-by-default).

I tested with a mingw / gcc 7.5 (without ASLR) and it works.

I use last MTuner release from github (v4.5.0).

Thanks in advance for your help.

milostosic commented 1 year ago

Hello,

I don't use MSys2 and related toolchains, can you provide details on how to setup the environment that matches what you have? I'd like to try and reproduce this but I'll need more info.

mbstoner53 commented 1 year ago

I am having the same problem in conjunction with gcc 12.2. I'm using mingw64 in windows 10. The toolchains setup dialog says "toolchain found!".

Everything else works but names and lines are missing. I compiled and linked with g++.exe -std=c++20 -g3.

I've tried building the .exe file with extra options like -no-pie and -Wl,--disable-dynamicbase. These don't fix the missing names.

The problem might be something to do with newer add2line.exe version. This is what my "--version" gives...

GNU addr2line (GNU Binutils) 2.39