On Wed, Jan 13, 2016 at 12:08:25PM +0300, Maxim Ostapenko wrote: > in OS X 10.11+ or iOS 9.0+, dyld will interpose even if > DYLD_INSERT_LIBRARIES is not set. This means, that it's not safe to use > "setenv" function to set DYLD_INSERT_LIBRARIES in MaybeReexec, because ASan > interceptors already established and we can easily end up with something > like this: > > AsanInitInternal -> MaybeReexec -> setenv -> some intercepted function (say, > memmove) -> BOOM. > > In fact, there is no need to reexec at all on such platforms, because we > already have working interceptors. Thus, for now we have completely broken > ASan for OS X 10.11+ and iOS 9.0+ with GCC 5. > > Upstream ASan already has a fix for the issue, as well as GCC 6, so the > proper solution would be just cherry-picking corresponding commits (r224315 > and r241487) from upstream to gcc-5-branch. > > Regtested and bootstrapped on x86_64-unknown-linux-gnu by myself and on > x86_64-apple-darwin15.2.0 by Dominique > (https://gcc.gnu.org/ml/gcc-testresults/2016-01/msg01115.html). > > Ok for gcc-5-branch?
Ok, thanks. > libsanitizer/ChangeLog: > > 2016-01-13 Maxim Ostapenko <m.ostape...@partner.samsung.com> > > * PR sanitizer/69147 > * asan/asan_mac.cc: Cherry pick upstream r241487. > * sanitizer_common/sanitizer_mac.cc: Cherry pick upstream r224315. > * sanitizer_common/sanitizer_mac.h: Likewise. Jakub