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 lives in Berlin, Germany and works as a Solutions Architect at Google Cloud.

While mostly focusing on Cloud-related stuff these days, Johannes still enjoys the occasional dose of Win32, COM, and NT kernel mode development.

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) hotmail com

LinkedIn Profile
Xing Profile
Github Profile
Advertisements

%d bloggers like this: