c++ - How to get ASan working with a 4.12.3 Linux kernel? -


i'm trying set / fix asan in docker container. use trivial example program

int main() { return 16; } 

and compile with

clang++ -std=c++1z -o1 -fsanitize=address test.cpp 

with clang 4.0.1 (it makes no difference -std use).

this produces error 4.12.3-1-arch kernel version, , none of things pulled of google or asan faq seem change this.

$ ./a.out  ==13178==shadow memory range interleaves existing memory mapping. asan cannot proceed correctly. aborting. ==13178==asan shadow supposed located in [0x00007fff7000-0x10007fff7fff] range. ==13178==process memory map follows:     0x00eda9b0a000-0x00eda9c4e000   /tmp/a.out     0x00eda9e4e000-0x00eda9e4f000   /tmp/a.out     0x00eda9e4f000-0x00eda9e52000   /tmp/a.out     0x00eda9e52000-0x00edaab37000        0x7f4266de9000-0x7f426713b000        0x7f426713b000-0x7f42672d8000   /usr/lib/libc-2.25.so     0x7f42672d8000-0x7f42674d7000   /usr/lib/libc-2.25.so     0x7f42674d7000-0x7f42674db000   /usr/lib/libc-2.25.so     0x7f42674db000-0x7f42674dd000   /usr/lib/libc-2.25.so     0x7f42674dd000-0x7f42674e1000        0x7f42674e1000-0x7f42674f7000   /usr/lib/libgcc_s.so.1     0x7f42674f7000-0x7f42676f6000   /usr/lib/libgcc_s.so.1     0x7f42676f6000-0x7f42676f7000   /usr/lib/libgcc_s.so.1     0x7f42676f7000-0x7f42676f8000   /usr/lib/libgcc_s.so.1     0x7f42676f8000-0x7f42676fb000   /usr/lib/libdl-2.25.so     0x7f42676fb000-0x7f42678fa000   /usr/lib/libdl-2.25.so     0x7f42678fa000-0x7f42678fb000   /usr/lib/libdl-2.25.so     0x7f42678fb000-0x7f42678fc000   /usr/lib/libdl-2.25.so     0x7f42678fc000-0x7f4267903000   /usr/lib/librt-2.25.so     0x7f4267903000-0x7f4267b02000   /usr/lib/librt-2.25.so     0x7f4267b02000-0x7f4267b03000   /usr/lib/librt-2.25.so     0x7f4267b03000-0x7f4267b04000   /usr/lib/librt-2.25.so     0x7f4267b04000-0x7f4267b1d000   /usr/lib/libpthread-2.25.so     0x7f4267b1d000-0x7f4267d1c000   /usr/lib/libpthread-2.25.so     0x7f4267d1c000-0x7f4267d1d000   /usr/lib/libpthread-2.25.so     0x7f4267d1d000-0x7f4267d1e000   /usr/lib/libpthread-2.25.so     0x7f4267d1e000-0x7f4267d22000        0x7f4267d22000-0x7f4267e33000   /usr/lib/libm-2.25.so     0x7f4267e33000-0x7f4268032000   /usr/lib/libm-2.25.so     0x7f4268032000-0x7f4268033000   /usr/lib/libm-2.25.so     0x7f4268033000-0x7f4268034000   /usr/lib/libm-2.25.so     0x7f4268034000-0x7f42681ae000   /usr/lib/libstdc++.so.6.0.24     0x7f42681ae000-0x7f42683ad000   /usr/lib/libstdc++.so.6.0.24     0x7f42683ad000-0x7f42683b7000   /usr/lib/libstdc++.so.6.0.24     0x7f42683b7000-0x7f42683b9000   /usr/lib/libstdc++.so.6.0.24     0x7f42683b9000-0x7f42683bc000        0x7f42683bc000-0x7f42683df000   /usr/lib/ld-2.25.so     0x7f42685b7000-0x7f42685c9000        0x7f42685cb000-0x7f42685da000        0x7f42685da000-0x7f42685df000        0x7f42685df000-0x7f42685e0000   /usr/lib/ld-2.25.so     0x7f42685e0000-0x7f42685e1000   /usr/lib/ld-2.25.so     0x7f42685e1000-0x7f42685e2000        0x7ffda4652000-0x7ffda4673000   [stack]     0x7ffda46cc000-0x7ffda46cf000   [vvar]     0x7ffda46cf000-0x7ffda46d1000   [vdso]     0xffffffffff600000-0xffffffffff601000   [vsyscall] ==13178==end of process memory map. 

this probly caused recent changes in kernel change way loads pie executables. issue under discussion upstream.

currently workaround (besides using older kernel) recompile 1 of

  • cflags += -no-pie
  • cflags += -mllvm -asan-force-dynamic-shadow=1 (clang only)

Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -