The Region of Memory about to be Freed Contains an Active Lock

Application Verifier stop message

Locks violation detected. The region of memory about to be freed contains an active lock.

Probable cause

This stop is generated if the memory containing a critical section was freed but the critical section has not been deleted using DeleteCriticalSection.

Typically, this stop will be encountered if a previous stop was continued. For example, if you encountered the Memory location at <address> contains an active lock stop and then chose to continue running the code. In most cases, the lock verifier detects immediately leaked critical sections contained in a heap allocation, a DLL range, a virtual memory allocation, or a MapViewOfFile mapped memory range and issues different stops in these cases. So there are very few cases left for this verifier stop.

Information displayed by Application Verifier in Tool Window

Lock – Critical section address

Owner – N/A

DebugInfo – N/A

Description – The region of memory about to be freed contains an active lock.

Trace Description – Critical Section initialization

Additional information

The call stack in the tool window shows where the critical section was initialized.

Check the contents of the current call stack when the memory was released.

Frequency of this error is low.

See Also

Concepts

Lock Verifier
Memory Location Contains an Active Lock