[PATCH] D65221: [Sanitizer][ASAN][MSAN] Fix infinite recursion on FreeBSD

Alexander Richardson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 26 02:43:15 PDT 2019


arichardson marked an inline comment as done.
arichardson added inline comments.


================
Comment at: compiler-rt/lib/sanitizer_common/sanitizer_linux.cc:788
+  if (!real_sysctlbyname)
+    real_sysctlbyname = (syctlbyname_ptr)dlfunc(RTLD_DEFAULT, "sysctlbyname");
+  CHECK(real_sysctlbyname);
----------------
devnexen wrote:
> MaskRay wrote:
> > When is `dlfunc(RTLD_DEFAULT, "sysctlbyname")` used?
> I wonder the same do you have a situation when it occurs ?
Indeed that does seem unlikely (I guess it could theoretically happen statically linking the runtime into libc?).
I copied this code from the sanitizer_netbsd.cc file and assumed there might be a case where the RTLD_DEFAULT case is needed.
But it does seem like more things would break if this is ever needed so I'll remove it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65221





More information about the llvm-commits mailing list