[PATCH] [Tsan] Do not intercept non-FreeBSD functions on FreeBSD

Viktor Kutuzov vkutuzov at accesssoftek.com
Fri Oct 24 01:05:32 PDT 2014


> What does happen with the current code? Does the binary crash? Or it works but you don't want unnecessary interceptors in the binary?

With the current code we fail on ThreadSanitizer-Unit :: unit/TsanUnitTest/Mman.CallocOverflow:

  FATAL: ThreadSanitizer: failed to intercept __xstat

This is because running the test causes calling stat() the interceptor of which relies on __xstat() that does not exist on FreeBSD.

Removing dead interceptors from the binary is good, but the major point is that we do not define things that do not exist on FreeBSD so the compiler will let us know as soon as we're trying to refer them. Thus, with the __xstat() interceptor removed we have a compile-time error for the original stat() interceptor exposing the invalid dependency.

http://reviews.llvm.org/D5858






More information about the llvm-commits mailing list