我正在尝试在我的 docker 容器中设置/修复 asan。为此,我使用了一个简单的示例程序
int main() { return 16; }
并编译它
clang++ -std=c++1z -O1 -fsanitize=address test.cpp
使用 clang 4.0.1(我使用它没有区别-std
)。
这会产生4.12.3-1-ARCH
内核版本的错误,而我从谷歌或 asan FAQ 中提取的所有内容似乎都没有改变这一点。
$ ./a.out
==13178==Shadow memory range interleaves with an existing memory mapping. ASan cannot proceed correctly. ABORTING.
==13178==ASan shadow was supposed to be located in the [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.