|
From: Bart V. A. <bar...@gm...> - 2009-03-30 14:42:13
|
On Mon, Mar 30, 2009 at 4:33 PM, Konstantin Serebryany <kon...@gm...> wrote: > On Mon, Mar 30, 2009 at 6:22 PM, Bart Van Assche > <bar...@gm...> wrote: >> On Mon, Mar 30, 2009 at 3:17 PM, Konstantin Serebryany >> <kon...@gm...> wrote: >>> Does valgrind core do something special about TLS (thread-local storage)? >> >> Are you familiar with the implementation of TLS in the NPTL ? > > Nope. You? Did you check whether DRD reports a false positive on your TLS test case ? If I remember correctly, the NPTL allocates an area at the top of the stack of each thread for internal use. This area contains a.o. a lookup table for pthread_key_t values, and this lookup table is accessed from more than one thread. The race conditions triggered by using TLS are in this lookup table. This is why the Drd tool ignores the top-of-stack area allocated by the NPTL. Suppressing race reports on _dl_allocate_tls_init() in Helgrind and ThreadSanitizer might help, but I'm not sure this is a full solution. Bart. |