The Lock Count is Invalid

Application Verifier stop message

Locks violation detected. The lock count is invalid: actual lock count <count>, expected <count>.

Probable cause

This stop is generated if a critical section is owned by a thread or is un-initialized and the critical section is deleted. If the owning thread is 0, the critical section has not been initialized.

Information displayed by Application Verifier in Tool Window

Lock – Critical section address

Owner – Thread Identifier – owning thread. 0 if un-initialized

DebugInfo – N/A

Description - The lock count is invalid: actual lock count <count>, expected <count>

Trace Description - Blank

Additional information

If the owner is zero, then the critical section is being deleted with out initializing. If it is not zero, it is being deleted while a thread still owns the critical section (e.g. LeaveCriticalSection has not been called).

Frequency of this stop is high.

See Also

Concepts

Lock Verifier