[compiler-rt] r182374 - [Sanitizer] Print verbose warning if symbolizer can't read /proc/self/exe for some reason

Alexey Samsonov samsonov at google.com
Tue May 21 05:22:36 PDT 2013


Author: samsonov
Date: Tue May 21 07:22:36 2013
New Revision: 182374

URL: http://llvm.org/viewvc/llvm-project?rev=182374&view=rev
Log:
[Sanitizer] Print verbose warning if symbolizer can't read /proc/self/exe for some reason

Modified:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_linux_libcdep.cc

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_linux_libcdep.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_linux_libcdep.cc?rev=182374&r1=182373&r2=182374&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_linux_libcdep.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_linux_libcdep.cc Tue May 21 07:22:36 2013
@@ -155,9 +155,12 @@ static int dl_iterate_phdr_cb(dl_phdr_in
     // First module is the binary itself.
     uptr module_name_len = internal_readlink(
         "/proc/self/exe", module_name.data(), module_name.size());
-    if (internal_iserror(module_name_len)) {
+    int readlink_error;
+    if (internal_iserror(module_name_len, &readlink_error)) {
       // We can't read /proc/self/exe for some reason, assume the name of the
       // binary is unknown.
+      Report("WARNING: readlink(\"/proc/self/exe\") failed with errno %d, some "
+             "stack frames may not be symbolized\n", readlink_error);
       module_name_len = internal_snprintf(module_name.data(),
                                           module_name.size(), "/proc/self/exe");
     }





More information about the llvm-commits mailing list