staticanalysis / data-race-test

Automatically exported from code.google.com/p/data-race-test
0 stars 0 forks source link

Assertion 'wait_cv_and_mu_set_ == false' failed #14

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
(initially reports by jyasskin on python)

tsan fails in assertion on test158:

ThreadSanitizer: thread_sanitizer.cc:3803 (void 
Thread::HandleWaitBefore(uintptr_t, uintptr_t)): Assertion 'wait_cv_and_mu_set_ 
== false' failed.
==22586==    at 0x38085CF4: report_and_quit (m_libcassert.c:145)
==22586==    by 0x38085F77: vgPlain_assert_fail (m_libcassert.c:217)
==22586==    by 0x3805F209: Detector::HandleWaitBefore() 
(thread_sanitizer.cc:3803)
==22586==    by 0x3801B27C: ThreadSanitizerHandleOneEvent(Event*) 
(thread_sanitizer.cc:4996)
==22586==    by 0x380235F1: Put(EventType, int, unsigned long, unsigned long, 
unsigned long) (ts_valgrind.cc:298)
==22586==    by 0x380239CA: ts_handle_client_request(unsigned int, unsigned 
long*, unsigned long*) (ts_valgrind.cc:575)
==22586==    by 0x380BDA8E: vgPlain_scheduler (scheduler.c:1498)
==22586==    by 0x380E6D29: run_a_thread_NORETURN (syswrap-linux.c:91)
==22586==    by 0x380E6F2A: vgModuleLocal_start_thread_NORETURN 
(syswrap-linux.c:214)
==22586==    by 0x380E993D: ??? (in 
/home/kcc/tsan_inst/lib/valgrind/tsan-amd64-linux)
==22586==    by 0xDEADBEEFDEADBEEE: ???
==22586==    by 0xDEADBEEFDEADBEEE: ???
==22586==    by 0xDEADBEEFDEADBEEE: ???

What happens: 

sem_wait_WRK (or similar) generates event 'WAIT_BEFORE'
signall arrives 
signal handler make some other sync call which generates event 'WAIT_BEFORE'

Current tsan's logic assumes that WAIT_BEFORE must be followed by WAIT_AFTER 
and the assertion fires. 

Original issue reported on code.google.com by konstant...@gmail.com on 11 Jan 2010 at 9:50

GoogleCodeExporter commented 9 years ago

Original comment by konstant...@gmail.com on 11 Jan 2010 at 9:54

GoogleCodeExporter commented 9 years ago
fixed by r1390.

Original comment by konstant...@gmail.com on 11 Jan 2010 at 10:37