[PATCH] D63877: Avoid infinite loop with asan interception

serge via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 28 01:11:28 PDT 2019


serge-sans-paille marked an inline comment as done.
serge-sans-paille added inline comments.


================
Comment at: compiler-rt/test/asan/TestCases/dlopen-mixed-c-cxx.c:5
+//
+// CHECK: AddressSanitizer CHECK failed
+#ifdef __cplusplus
----------------
serge-sans-paille wrote:
> yln wrote:
> > Which check fails here?
> > Ideally, it would be this one: https://github.com/llvm/llvm-project/blob/29d05c005fa88b3a59697a2e538f46cf79413548/compiler-rt/lib/asan/asan_interceptors.h#L126
> It's not :-/ We get
> 
> ```
> ==25385==AddressSanitizer CHECK failed: /home/sguelton/sources/llvm-project/compiler-rt/lib/asan/asan_interceptors.cc:328 "((__interception::real___cxa_throw)) != (0)" (0x0, 0x0)
>     #0 0x4b84e5 in __asan::AsanCheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) /home/sguelton/sources/llvm-project/compiler-rt/lib/asan/asan_rtl.cc:73:5
>     #1 0x4d2ef9 in __sanitizer::CheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) /home/sguelton/sources/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_termination.cc:78:24
>     #2 0x433d0c in __interceptor___cxa_throw /home/sguelton/sources/llvm-project/compiler-rt/lib/asan/asan_interceptors.cc:328:3
>     #3 0x7f6d8defeabe in foo() /home/sguelton/sources/llvm-project/_build/projects/compiler-rt/test/asan/X86_64LinuxConfig/TestCases/<stdin>:10:3
>     #4 0x7f6d8defe99c in bar /home/sguelton/sources/llvm-project/_build/projects/compiler-rt/test/asan/X86_64LinuxConfig/TestCases/<stdin>:18:5
>     #5 0x4e91b9 in main /home/sguelton/sources/llvm-project/compiler-rt/test/asan/TestCases/dlopen-mixed-c-cxx.c:37:10
>     #6 0x7f6d916593d4 in __libc_start_main (/lib64/libc.so.6+0x223d4)
>     #7 0x41ac11 in _start (/home/sguelton/sources/llvm-project/_build/projects/compiler-rt/test/asan/X86_64LinuxConfig/TestCases/Output/dlopen-mixed-c-cxx.c.tmp.out+0x41ac11)
> ```
My bad, with the right verbosity level, I indeed get

'==17519==AddressSanitizer: failed to intercept '__cxa_throw'



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63877/new/

https://reviews.llvm.org/D63877





More information about the llvm-commits mailing list