AddressSanitizer: Properly handle dispatch_source_set_cancel_handler with a
NULL handler

Per
https://developer.apple.com/library/mac/documentation/Performance/Reference/GCD_libdispatch_Ref/index.html,
the dispatch_source_set_cancel_handler() API *can* be called with a NULL
handler. In that case, the libdispatch removes an already existing cancellation
handler, if there was one. ASan's interceptor always creates a new block that
always tries to call the original handler. In case the original block is NULL,
a segmentation fault happens. Let's fix that by not wrapping a NULL-block at
all.

It looks like all the other libdispatch APIs (which we intercept) do *not*
allow NULL. So it's really only the dispatch_source_set_cancel_handler one that
needs this fix.

Reviewed at http://reviews.llvm.org/D6747




git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@224711 91177308-0d34-0410-b5e6-96231b3b80d8
AddressSanitizer: Abort after failed exec() and get rid of the allow_reexec ASan flag

As mentioned in
https://code.google.com/p/address-sanitizer/issues/detail?id=365, when the
re-exec that adds the required DYLD_INSERT_LIBRARIES variable fails, ASan
currently continues to run, but things are broken (some memory can be
overwritten, interceptors don't work, ...). This patch aborts if the execv()
fails and prints an error message that DYLD_INSERT_LIBRARIES is required. It
also removes the "alllow_reexec" flag, since using it causes the same issues.

Reviewed at http://reviews.llvm.org/D6752




git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@224712 91177308-0d34-0410-b5e6-96231b3b80d8