MINGW-packages: AddressSanitizer does not appear to be available for mingw-w64-x86_64-gcc
OS: Windows 10 x64, version 1703 (build 15063.726)
Steps to reproduce:
- Install MSYS2, default values
- Update MSYS2,
pacman -Syyu
, use ctrl+C to close pacman then close window - Update MSYS2 again,
pacman -Syyu
- Install GCC and nano,
pacman -Sy mingw-w64-x86_64-gcc nano
- Open a MinGW 64bit session from the Start menu
- Open nano to create a new .cpp file,
nano test.cpp
- Paste following code into nano,
int main(int argc, char **argv) {
int *array = new int[100];
array[0] = 0;
int res = array[argc + 100]; // BOOM
delete [] array;
return res;
}
- Try to compile,
g++ -fsanitize=address -O1 test.cpp -o test
Output:
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lasan
collect2.exe: error: ld returned 1 exit status
So, is AddressSanitizer available within the MinGW-w64 project?
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 19
- Comments: 22
Commits related to this issue
- AddressSanitizer does not appear to be available for mingw-w64-x86_64-gcc https://github.com/msys2/MINGW-packages/issues/3163 — committed to JoergAtGithub/hidapi by Youw a year ago
- 🎨 remove AddressSanitizer since MSYS2 doesn't support it https://github.com/msys2/MINGW-packages/issues/3163 — committed to PaytonWu/abc by PaytonWu 6 months ago
hey follks
I don’t want to use CL. I dont know. I’m compiling everything with GCC (mingw-w64).
What are the tools I can use in Windows to detect memory leaks?
Sanitizers are not supported by GCC on Windows.
Let me clarify it: what benefit do you expect from using Clang+sanitizers in
mingw64
environment compared to Clang+sanitizers inclang64
environment?I m also facing the same issue.I didn’t got any solution for that. I m also trying to build clang from Mingw on windows , It is giving error that I cant find any solution.Please let me know If you guys find any solution