[PATCH] D46638: [sanitizer] Fix runtime crash on 32-bit Linux with glibc 2.27

Jakub JelĂ­nek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 9 08:04:13 PDT 2018


jakubjelinek added inline comments.


================
Comment at: lib/sanitizer_common/sanitizer_linux_libcdep.cc:165
+  glibc_version_fn get_glibc_version =
+    (glibc_version_fn)dlsym(RTLD_NEXT, "gnu_get_libc_version");
+  if (!get_glibc_version)
----------------
So you both call dlsym (instead of the function directly) and then parse the string?  That is significantly larger and more expensive than just calling the dlvsym.  Furthermore, other code in the sanitizers use confstr for this purpose.


================
Comment at: lib/sanitizer_common/sanitizer_linux_libcdep.cc:202
+  int minor, patch;
+  GetGlibcVersion(&minor, &patch);
+  // Glibc before 2.27 used a different calling convention for
----------------
Ugh, so you call this unconditionally on all architectures, just because one needs it?


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D46638





More information about the llvm-commits mailing list