Commit Graph

5 Commits

Author SHA1 Message Date
Maxim Ostapenko fe863a6510 [lsan] Avoid segfaults during threads destruction under high load
This patch addresses two issues:

	* It turned out that suspended thread may have dtls->dtv_size == kDestroyedThread (-1)
	and LSan wrongly assumes that DTV is available. This leads to SEGV when LSan tries to
	iterate through DTV that is invalid.
	* In some rare cases GetRegistersAndSP can fail with errno 3 (ESRCH). In this case LSan
	assumes that the whole stack of a given thread is available. This is wrong because ESRCH
	can indicate that suspended thread was destroyed and its stack was unmapped. This patch
	properly handles ESRCH from GetRegistersAndSP in order to avoid invalid accesses to already
	unpapped threads stack.

Differential Revision: https://reviews.llvm.org/D30818

llvm-svn: 299630
2017-04-06 07:42:27 +00:00
Evgeniy Stepanov 7f6290ca9a [sanitizer] Recognize static TLS in __tls_get_addr interceptor.
Current code tries to find the dynamic TLS header to the left of the
TLS block without checking that it's not a static TLS allocation.

llvm-svn: 237495
2015-05-16 00:34:15 +00:00
Evgeniy Stepanov 7ad0bde843 [msan] Fix false positive on dynamic tls.
Use existing DTLS code in sanitizer_tls_get_addr.{h,cc} to unpoison DTLS
blocks both on allocation and deallocation.

https://code.google.com/p/memory-sanitizer/issues/detail?id=44

llvm-svn: 211683
2014-06-25 11:30:35 +00:00
Alp Toker 1ee7fc7a1a Fix typos
llvm-svn: 208841
2014-05-15 02:22:34 +00:00
Kostya Serebryany 71788fac2a [asan] experimental intercetor for __tls_get_addr. So far it does nothing interesting, actual usage will come later. See https://groups.google.com/forum/#!topic/address-sanitizer/BfwYD8HMxTM for background
llvm-svn: 200384
2014-01-29 09:29:16 +00:00