The sanitizer address will not work with bash on windows

Llvm, clang, clang-format and clang-modernize are currently running on Ubuntu Bash on Windows. I would like to use the google sanitation toolkit, including address, memory and thread. None of the fsanitize options work.

Here is a sample code for ASAN:

#include <stdlib.h> int main() { char *x = (char *)malloc(10 * sizeof(char *)); free(x); return x[5];// purposely accessing deallocated memory } 

Here is the clang call in bash in windows:

 $clang++-3.5 -fsanitize=address -o1 -fno-omit-frame-pointer -g main.cpp -o main $./main 

results

 ==70==Sanitizer CHECK failed: build/buildd/llvm-toolchain-snapshot-3.5/projects/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_linux.cc:211 ((IsOneOf(*current_, 's', 'p'))) != (0)(0,0) 

I would like suggestions on how to make it work, or if I miss part of the tool chain or something like that.

Otherwise, I assume that I will boot Ubuntu or Debian with dual boot, because clang for Windows does not contain the simplest functions such as std: out support, although ideally I would like to compile for both Windows and Linux I would like to avoid double booting, though, since Ubuntu cannot mount Windows storage areas, but they seem to be well served by Ubuntu Bash in windows.

+6
source share
1 answer

Quick view in source code - MemoryMappingLayout :: Next - https://llvm.org/svn/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_procmaps_linux.cc - it seems the problem is that bash on ubuntu Windows support for the / proc file system is incomplete.

Incorrect code looks at / proc / self / maps, which in fact seems correct.

But I found that other things (like networks) in / proc are completely broken down into bashonwindowsonunix - so I'm sure the part is the work in progress.

+2
source

All Articles