]> git.ipfire.org Git - thirdparty/valgrind.git/commit
Add option a new sim-hint no-nptl-pthread-stackcache.
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Tue, 19 Aug 2014 22:46:44 +0000 (22:46 +0000)
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Tue, 19 Aug 2014 22:46:44 +0000 (22:46 +0000)
commit8e605f14c58a740d05f888508e1e4cf0cddf70b8
tree32b4e4e052bbc272adc00d3618ef54238d826fcd
parentd31fe530ff223be42a3d261f1f9c3cc6e65abc05
Add option a new sim-hint  no-nptl-pthread-stackcache.

Activating this hint using --sim-hints=no-nptl-pthread-stackcache
means the glibc nptl stack cache will be disabled.

Disabling this stack/tls cache avoids helgrind false positive race conditions
errors when using __thread variables.

Note: disabling the stack cache is done by a kludge, dependent on
internal knowledge of glibc code, and using libpthread debug info.
So, this kludge might be broken with newer glibc version.
This has been tested on various platforms and various
glibc versions 2.11, 2.16 and 2.18

To check if the disabling works, you can do:
valgrind --tool=helgrind --sim-hints=no-nptl-pthread-stackcache -d -v ./helgrind/tests/tls_threads |& grep kludge

If you see the below 2 lines, then hopefully the stack cache has been disabled.
--12624-- deactivate nptl pthread stackcache via kludge: found symbol stack_cache_actsize at addr 0x3AF178
--12624:1:sched    pthread stack cache size disabling done via kludge

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14313
15 files changed:
coregrind/m_clientstate.c
coregrind/m_main.c
coregrind/m_redir.c
coregrind/m_scheduler/scheduler.c
coregrind/pub_core_clientstate.h
coregrind/pub_core_options.h
docs/xml/manual-core.xml
helgrind/docs/hg-manual.xml
helgrind/tests/Makefile.am
helgrind/tests/tls_threads.c [new file with mode: 0644]
helgrind/tests/tls_threads.stderr.exp [new file with mode: 0644]
helgrind/tests/tls_threads.stdout.exp [new file with mode: 0644]
helgrind/tests/tls_threads.vgtest [new file with mode: 0644]
none/tests/cmdline1.stdout.exp
none/tests/cmdline2.stdout.exp