[PATCH] Allow initialization of Asan interceptors before the general Asan initialization takes place on FreeBSD

Viktor Kutuzov vkutuzov at accesssoftek.com
Mon Jul 14 08:00:47 PDT 2014


Here's how things currently look during initialization on FreeBSD:

  #0  AsanInitInternal () at /usr/home/ik/llvm/llvm.current/projects/compiler-rt/lib/asan/asan_rtl.cc:695
  #1  0x0000000000411d7a in __interceptor_strncmp () at sanitizer_common_interceptors.inc:178
  #2  0x000000080109e35e in getenv () from /lib/libc.so.7
  #3  0x0000000801302d03 in pthread_timedjoin_np () from /lib/libthr.so.3
  #4  0x00000008013055d2 in __error () from /lib/libthr.so.3
  #5  0x00000008012f9bd6 in .init () from /lib/libthr.so.3
  #6  0x00007fffffffd0d0 in ?? ()
  #7  0x000000080065d611 in r_debug_state () from /libexec/ld-elf.so.1
  #8  0x000000080065cc97 in __tls_get_addr () from /libexec/ld-elf.so.1
  #9  0x000000080065b089 in .text () from /libexec/ld-elf.so.1
  #10 0x0000000000000000 in ?? ()

Note that an intercepted function is called before Asan has a chance to initialize itself.

The fix eliminates mass failures on Asan tests--both unit and lit ones.

http://reviews.llvm.org/D4496






More information about the llvm-commits mailing list