When TSAN fails to do setrlimit ...

bash-4.1$ uname -r

2.6.32-504.16.2.el6.x86_64

bash-4.1$ a.out

bash-4.1$ ulimit -v 100000000000

bash-4.1$ a.out

==26389==WARNING: Program is run with limited virtual address space, which wouldn't work with ThreadSanitizer.

==26389==Re-execing with unlimited virtual address space.

==26389==ERROR: ThreadSanitizer setrlimit() failed 1

bash-4.1$ ulimit -v 1000000000

bash-4.1$ a.out

FATAL: ThreadSanitizer CHECK failed: /u/tools/src/llvm/projects/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_allocator.h:326 "((kSpaceBeg)) == (( reinterpret_cast<uptr>(MmapNoAccess(kSpaceBeg, kSpaceSize))))" (0x7d0000000000, 0xfffffffffffffff4)

==26469==FATAL: ThreadSanitizer: failed to intercept pthread_mutex_lock

bash-4.1$

Why do I get the curious looking message when virtual memory is set below a certain value instead of the self-explanatory setrlimit() failed message? Is this a known issue?

-Riyaz

See http://clang.llvm.org/docs/ThreadSanitizer.html#limitations :
"ThreadSanitizer maps (but does not reserve) a lot of virtual address
space. This means that tools like ulimit may not work as usually
expected."