Right now, when you have an invalid memory address, asan would just crash and does not offer much useful info.
This patch attempted to give a bit more detail on the access.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
compiler-rt/lib/asan/asan_descriptions.cpp | ||
---|---|---|
473 | I guess this math is confusing and applies only to Even __asan_region_is_poisoned can return a different offset from the range, not sure what is going to happen with other callers. e.g. if we change change the test to We can't get access begin from this addr/size in general. |
compiler-rt/lib/asan/asan_descriptions.cpp | ||
---|---|---|
473 | Good point. Thanks! |
compiler-rt/lib/asan/asan_descriptions.cpp | ||
---|---|---|
470–472 | maybe |
compiler-rt/test/asan/TestCases/wild_pointer.cpp | ||
---|---|---|
11 | @vitalybuka : btw, do you know why this inclusion doesn't work here? (ie., if I uncomment it, it'd cause "file not found" error) |
compiler-rt/test/asan/TestCases/wild_pointer.cpp | ||
---|---|---|
11 | lsan probably somehow adds include dir Why not just printf("Expected bad addr: %p", p+offset) |
compiler-rt/test/asan/TestCases/wild_pointer.cpp | ||
---|---|---|
2–4 | -m64 is not enough it tests are being executed on 32bit platform |
updated diff
compiler-rt/test/asan/TestCases/wild_pointer.cpp | ||
---|---|---|
2–4 | Cool! I didn't know asan-64-bits was a thing! |
This makes clang crash when building the adam runtime O_o: http://45.33.8.238/linux/41534/step_4.txt
That's a clang bug, but it als
o breaks the build. So I'm afraid you'll have to revert this until that clang crash is fixed :/
Broke the test on Windows: https://lab.llvm.org/buildbot/#/builders/127/builds/7495
C:\b\slave\sanitizer-windows\llvm-project\compiler-rt\test\asan\TestCases\wild_pointer.cpp:20:11: error: CHECK: expected string not found in input // CHECK: Expected bad addr: [[ADDR:0x[0-9,a-f]+]] ^ <stdin>:1:1: note: scanning from here Expected bad addr: 4567998FA7CF6839
I guess Windows has a different printf format.
Please fix.
I've sent https://reviews.llvm.org/D98570
(Dont have a windows to test it, but I *think* it should work. PTAL Thanks!)
maybe