[PATCH] D63877: Avoid infinite loop with asan interception
Julian Lettner via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 28 10:15:33 PDT 2019
yln added inline comments.
================
Comment at: compiler-rt/lib/interception/interception_linux.cc:49
// RTLD_DEFAULT.
addr = dlsym(RTLD_DEFAULT, name);
+
----------------
yln wrote:
> Do we understand why we need still want the pointer, even if we don't intercept functions? Or is the comment wrong?
> https://reviews.llvm.org/D39779
>
> I intended to change `InterceptFunction` to return true only on when "interception was successful", but I missed this case here.
> > If the lookup using RTLD_NEXT failed ... we cannot intercept this function.
> Currently, we still return true, because we got an address `addr && (func == wrapper)`.
>
> The original patch added a test that checks:
> ```
> // Tests that ubsan can detect errors on Android if libc appears before the
> // runtime in the library search order, which means that we cannot intercept
> // symbols.
> ```
> It's not obvious to me why we need to lookup the pointer if none of our interceptors run!?
Just to be clear, I am suggesting to try to remove the branch with `dlsym(RTLD_DEFAULT, ...)` altogether to find out the reason why it is there, but I don't want to block you on this.
LGTM; please get the okay from Vitaly.
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