Skip to content

AddressSanitizer does not appear to be available for mingw-w64-x86_64-gcc #3163

@ghost

Description

OS: Windows 10 x64, version 1703 (build 15063.726)

Steps to reproduce:

  1. Install MSYS2, default values
  2. Update MSYS2, pacman -Syyu, use ctrl+C to close pacman then close window
  3. Update MSYS2 again, pacman -Syyu
  4. Install GCC and nano, pacman -Sy mingw-w64-x86_64-gcc nano
  5. Open a MinGW 64bit session from the Start menu
  6. Open nano to create a new .cpp file, nano test.cpp
  7. 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;
}
  1. 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions