[PATCH] Clear LD_PRELOAD when forking external symbolizer.

Sergey Matveev earthdok at google.com
Tue Apr 23 02:55:25 PDT 2013


  > Why not simply unsetenv("LD_PRELOAD")?

  I thought unsetenv acquired a lock, which in fact it doesn't.


================
Comment at: lib/sanitizer_common/sanitizer_symbolizer_linux.cc:120
@@ -102,2 +119,3 @@
       internal_close(fd);
+    UnsetEnvVar("LD_PRELOAD");
     execl(path_to_symbolizer, path_to_symbolizer, (char*)0);
----------------
Alexander Potapenko wrote:
> If LD_PRELOAD contains more than one library, you only need to remove yours, not unset LD_PRELOAD completely.
How do we know which one is ours?


http://llvm-reviews.chandlerc.com/D704



More information about the llvm-commits mailing list