chanyancheung / data-race-test

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

ignore all sync in _getptd (win XP) #57

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
We are getting some false negatives (e.g. on PositiveTests.HarmfulRaceInDtorB) 
because some guts of ntdll.dll grab some locks. 
Here is one such stack: 

==2180==     #0  RtlEnterCriticalSection C:\WINDOWS\system32\ntdll.dll
==2180==     #1  RtlCompareUnicodeString C:\WINDOWS\system32\ntdll.dll
==2180==     #2  RtlCompareUnicodeString C:\WINDOWS\system32\ntdll.dll
==2180==     #3  LdrGetProcedureAddress C:\WINDOWS\system32\ntdll.dll
==2180==     #4  GetProcAddress C:\WINDOWS\system32\kernel32.dll
==2180==     #5  _decode_pointer 
f:/dd/vctools/crt_bld/self_x86/crt/src/tidtable.c:177
==2180==     #6  __set_flsgetvalue 
f:/dd/vctools/crt_bld/self_x86/crt/src/tidtable.c:259
==2180==     #7  _getptd_noexit 
f:/dd/vctools/crt_bld/self_x86/crt/src/tidtable.c:578
==2180==     #8  _getptd f:/dd/vctools/crt_bld/self_x86/crt/src/tidtable.c:641
==2180==     #9  _LocaleUpdate::_LocaleUpdate 
f:/dd/vctools/crt_bld/self_x86/crt/src/setlocal.h:264
==2180==     #10 _output_l f:/dd/vctools/crt_bld/self_x86/crt/src/output.c:2155
==2180==     #11 printf f:/dd/vctools/crt_bld/self_x86/crt/src/printf.c:63
==2180==     #12 printf f:/dd/vctools/crt_bld/self_x86/crt/src/printf.c:49
==2180==     #13 PositiveTests_HarmfulRaceInDtor::B::F 
e:/b/build/slave/full_winxp/build/unittest/racecheck_unittest.cc:3948
==2180==     #14 PositiveTests_HarmfulRaceInDtor::Thread1 
e:/b/build/slave/full_winxp/build/unittest/racecheck_unittest.cc:3955
==2180==     #15 MyThread::ThreadBody 
e:/b/build/slave/full_winxp/build/unittest/thread_wrappers_win.h:223
==2180==     #16 unnamedImageEntryPoint C:\WINDOWS\system32\kernel32.dll
==2180==     #17 unnamedImageEntryPoint C:\WINDOWS\system32\kernel32.dll

We probably need to do ignore_all_sync for _getptd. 
Maybe for some other similar functions.

Original issue reported on code.google.com by konstant...@gmail.com on 26 Nov 2010 at 3:56

GoogleCodeExporter commented 9 years ago
Once this is fixed, please re-enable the printf in 
PositiveTests.HarmfulRaceInDtorB

Original comment by konstant...@gmail.com on 26 Nov 2010 at 4:10