Status: New
Owner: [email protected]
Labels: Type-Defect Priority-Medium

New issue 357 by [email protected]: Uninstrumented linked-only executables fail to initialize ASan before main
https://code.google.com/p/address-sanitizer/issues/detail?id=357

On OS X 10.10, when you have an uninstrumented executable that only links to the ASan dylib, ASan doesn't get initialized before main(). This means that calling __asan_region_is_poisoned will crash because there is no shadow memory. See the attached test case, which currently fails on OS X.

I noticed that the Posix/start-deactivated.cc testcase occasionally randomly fails with a segfault, see http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_checkall/85/console , and I reduced the bug into this.

When there is any instrumented module, __asan_init will get called from the module constructor, but when we only link to the dylib, it doesn't get called before main. We should probably explicitly invoke __asan_init in a constructor within ASan runtime.

Attachments:
        linked_only.cc  696 bytes

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups 
"address-sanitizer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to