Skip to content
Commit 3182c3e4 authored by Alexander Potapenko's avatar Alexander Potapenko
Browse files

[ASan] Fix https://code.google.com/p/address-sanitizer/issues/detail?id=159

MaybeReexec() does now a tricky job to manage DYLD_INSERT_LIBRARIES in a safe way.

Because we're using library interposition, it's critical for an instrumented app
to be executed with the runtime library present in DYLD_INSERT_LIBRARIES list.
Therefore if it's initially missing in that list, we append the runtime library name
to the value of DYLD_INSERT_LIBRARIES and then exec() ourselves.

On the other hand, some of the apps exec()ed by our program may not want to have
ASan runtime library preloaded, so we remove the runtime library from the
DYLD_INSERT_LIBRARIES if it's already there.

Users may want to preload other libraries using DYLD_INSERT_LIBRARIES, so we preserve those.

llvm-svn: 175276
parent be2eced4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment