Why the application reports "cannot allocate memeory in static TLS block" when using Tsan?

1,568 views
Skip to first unread message

ran...@gmail.com

unread,
May 16, 2017, 1:32:14 PM5/16/17
to thread-sanitizer
Hi everyone,

When i compiles dynamic library with -fsanitize=thread -fPIC -pie and links with  -fsanitize=thread -fPIC -ltsan, the generated application will report a error like "XXX/lib64/libtsan.so.0:cannot allocate memory in static TLS block".

gcc version : 5.3
glibc version:2.18
linux version: suse linux 2.6.32.12-0.7-default

Dmitry Vyukov

unread,
May 16, 2017, 1:53:36 PM5/16/17
to thread-s...@googlegroups.com
Hi,

I don't remember ever seeing such error.

Searching internet "cannot allocate memory in static TLS block",
brings several suggestions:
2 suggest that adding -lpthread can fix the problem:
https://sourceware.org/ml/libc-help/2012-11/msg00032.html
https://github.com/cms-sw/cmsdist/issues/265

2 suggest bugs in glibc:
https://sourceware.org/bugzilla/show_bug.cgi?id=14898
https://github.com/dyninst/dyninst/issues/101

Generally, updating your software can help. E.g. 2.6.32 was released
long before we even started thinking about creating any of sanitizers.
We never tested on 2.6.32.
Reply all
Reply to author
Forward
0 new messages