Application Verifier: Thread cannot own a critical section

Whereas most Verifier error messages are rather descriptive, this one is not really:

VERIFIER STOP 00000200 : pid 0x2B4: 
Thread cannot own a critical section. 

0000104C : Thread ID.
05274FDC : Critical section address.
09D88FE0 : Critical section debug information address.
010135D4 : Critical section initialization stack trace.

Why should not this thread be allowed to own a critical section? What is Application Verifier trying to tell us? Luckily, the stack trace gives a hint:

ntdll.dll!_DbgBreakPoint@0() 	
vrfcore.dll!VerifierStopMessageEx(...)
vfbasics.dll!VfBasicsStopMessage()
vfbasics.dll!AVrfpCheckCriticalSection()
vfbasics.dll!AVrfpCheckCriticalSectionSplayNode()
vfbasics.dll!AVrfpCheckCriticalSectionTree()
vfbasics.dll!AVrfCheckForOrphanedCriticalSections()
vfbasics.dll!AVrfpCheckThreadTermination()
vfbasics.dll!AVrfpCheckCurrentThreadTermination()
vfbasics.dll!AVrfpStandardThreadFunction()
kernel32.dll!@BaseThreadInitThunk@12()
ntdll.dll!__RtlUserThreadStart@8()

So in fact, Application Verifier has detected that the thread currently being terminated is still owning a critical section. What a stupid error message for a simple problem…

Advertisements

Categories




About me

Johannes Passing, M.Sc., living in Berlin, Germany.

Besides his consulting work, Johannes mainly focusses on Win32, COM, and NT kernel mode development, along with Java and .Net. He also is the author of cfix, a C/C++ unit testing framework for Win32 and NT kernel mode, Visual Assert, a Visual Studio Unit Testing-AddIn, and NTrace, a dynamic function boundary tracing toolkit for Windows NT/x86 kernel/user mode code.

Contact Johannes: jpassing (at) acm org

Johannes' GPG fingerprint is BBB1 1769 B82D CD07 D90A 57E8 9FE1 D441 F7A0 1BB1.

LinkedIn Profile
Xing Profile
Github Profile

%d bloggers like this: