[PATCH] D9600: Add scan-build python implementation

Devin Coughlin via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 10 13:14:00 PST 2015


dcoughlin added inline comments.

================
Comment at: tools/scan-build-py/libear/ear.c:140
@@ +139,3 @@
+#ifdef HAVE_NSGETENVIRON
+    environ = *_NSGetEnviron();
+#endif
----------------
The issue I am seeing with library-interposition on OS X seems to be caused by eagerly stashing *_NSGetEnviron() in `environ`. This causes processes that modify their environment before execv'ing to drop the modified environments because interposition forwards execv to call_execve() with the stale environment.

To avoid this, you can replace all references to `environ` on Darwin with (*_NSGetEnviron()).


http://reviews.llvm.org/D9600





More information about the cfe-commits mailing list