[LLVMdev] radr://12777299, "potential pthread/eh bug exposed by libsanitizer"

Alexander Potapenko glider at google.com
Tue Dec 4 09:46:09 PST 2012


+kledzik at apple.com
The dynamic runtime is using dylib interposition (google for
"__DATA,__interpose).
If I'm understanding correctly (Nick, can you please confirm this?)
this allows to interpose the function regardless of the two-level
namespace.
The support for dynamic runtime in ASan is almost there. But the new
interposition method has revealed some issues with the allocator which
were corked here and there before. Most of those are caused by a
CoreFoundation dependency, which I'm trying to eliminate now.


On Mon, Dec 3, 2012 at 8:50 PM, Rafael EspĂ­ndola
<rafael.espindola at gmail.com> wrote:
> On 30 November 2012 13:32, Alexander Potapenko <glider at google.com> wrote:
>> No, we are not going to use mach_inject. This isn't portable and may
>> be even harder to set up than mach_override.
>> The new ASan runtime will use the dylib interposition and will in fact
>> require DYLD_INSERT_LIBRARIES to work. However ASan already handles it
>> correctly itself: if the corresponding env var is missing the app is
>> just re-execed.
>> Dylib interposition is supported by Apple and should work on iOS as
>> well as Mac OS. It will also probably simplify hooking the memory
>> allocations in ASan, which is now very tricky.
>
> This is interesting! I had some difficulties with mach_override myself
> in firefox. Don't you have to disable the two-level namespace to be
> able to override the functions you want? What currently blocks using
> DYLD_INSERT_LIBRARIES instead of mach_override?
>
> Cheers,
> Rafael



--
Alexander Potapenko
Software Engineer
Google Moscow




More information about the llvm-dev mailing list