The Recursion Count is Invalid

Application Verifier stop message

Locks violation detected. The recursion count is invalid: actual recursion count <count> - expected <count>.

Probable cause

This stop is generated if the recursion count field of the critical section structure is invalid in the current context. Recursion count is invalid usually when a thread calls LeaveCriticalSection more times than it called EnterCriticalSection.

Information displayed by Application Verifier in Tool Window

Lock – Critical section address

Owner – N/A

DebugInfo – Critical section debug information address

Description – The recursion count is invalid: actual recursion count <count> - expected <count>

Trace Description - Blank

Additional information

Check the current call stack to see who is using the corrupted critical section. Frequency of this error is low.

See Also

Concepts

Lock Verifier
Critical Section Over-Released or Corrupted