https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64350
Bug ID: 64350 Summary: TSAN fails after stress-testing for a while Product: gcc Version: 5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: sanitizer Assignee: unassigned at gcc dot gnu.org Reporter: bernd.edlinger at hotmail dot de CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org, jakub at gcc dot gnu.org, kcc at gcc dot gnu.org Hello, I see this fatal error from the thread sanitizer, after a while of stress-testing. As far as I can tell the application should not hold 64 locks at that time. Any ideas what that could be wrong here? Thanks, Bernd. FATAL: ThreadSanitizer CHECK failed: ../../../../gcc-5-20141214/libsanitizer/sanitizer_common/sanitizer_deadlock_detector.h:65 "((n_all_locks_)) < (((sizeof(all_locks_with_contexts_)/sizeof((all_locks_with_contexts_)[0]))))" (0x40, 0x40) #0 __tsan::TsanCheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) ../../../../gcc-5-20141214/libsanitizer/tsan/tsan_rtl_report.cc:42 (libtsan.so.0+0x000000071793) #1 __tsan::TsanCheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) ../../../../gcc-5-20141214/libsanitizer/tsan/tsan_rtl_report.cc:42 (libtsan.so.0+0x00000007179b) #2 __sanitizer::CheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) ../../../../gcc-5-20141214/libsanitizer/sanitizer_common/sanitizer_common.cc:72 (libtsan.so.0+0x0000000761b3) #3 __sanitizer::DeadlockDetectorTLS<__sanitizer::TwoLevelBitVector<1ul, __sanitizer::BasicBitVector<unsigned long> > >::addLock(unsigned long, unsigned long, unsigned int) ../../../../gcc-5-20141214/libsanitizer/sanitizer_common/sanitizer_deadlock_detector.h:65 (libtsan.so.0+0x000000079eed) #4 __sanitizer::DeadlockDetector<__sanitizer::TwoLevelBitVector<1ul, __sanitizer::BasicBitVector<unsigned long> > >::onLockAfter(__sanitizer::DeadlockDetectorTLS<__sanitizer::TwoLevelBitVector<1ul, __sanitizer::BasicBitVector<unsigned long> > >*, unsigned long, unsigned int) ../../../../gcc-5-20141214/libsanitizer/sanitizer_common/sanitizer_deadlock_detector.h:214 (libtsan.so.0+0x000000079eed) #5 __sanitizer::DD::MutexAfterLock(__sanitizer::DDCallback*, __sanitizer::DDMutex*, bool, bool) ../../../../gcc-5-20141214/libsanitizer/sanitizer_common/sanitizer_deadlock_detector1.cc:162 (libtsan.so.0+0x000000079eed) #6 __tsan::MutexLock(__tsan::ThreadState*, unsigned long, unsigned long, int, bool) ../../../../gcc-5-20141214/libsanitizer/tsan/tsan_rtl_mutex.cc:177 (libtsan.so.0+0x00000006e1e5) #7 pthread_mutex_lock ../../../../gcc-5-20141214/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:2993 (libtsan.so.0+0x0000000354c7) #8 interlockedSet(long*, long) /home/ed/OPCToolboxV5/Source/Core/TBUtil/Platforms.cpp:55 (CPPTestClient+0x000000ee1f06) #9 TB5Util::Sync::lock() include/Sync.h:218 (CPPTestClient+0x000000810842) [...] #19 pthread_start platforms/linux/opcua_p_thread.c:63 (CPPTestClient+0x000000fb7403) #20 __tsan_thread_start_func ../../../../gcc-5-20141214/libsanitizer/tsan/tsan_interceptors.cc:885 (libtsan.so.0+0x000000023a69) #21 start_thread <null> (libpthread.so.0+0x000000007e99) #22 __clone <null> (libc.so.6+0x0000000f42ec)