[PATCH] D63877: Avoid infinite loop with asan interception
serge via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 28 14:21:20 PDT 2019
serge-sans-paille marked an inline comment as done.
serge-sans-paille added inline comments.
================
Comment at: compiler-rt/lib/interception/interception_linux.cc:49
// RTLD_DEFAULT.
addr = dlsym(RTLD_DEFAULT, name);
+
----------------
yln wrote:
> 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.
Yeah, I felt that, and that's why I moved the patch inside that branch to show the fix is related to it. waiting for @vitalybuka then.
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