From time to time, when troubleshooting an application hang, using the Windows Debugger (WinDbg), you will run into orphaned critical sections.

In order to proceed with finding out which thread is abandoning the critical section in this process, we will need to use a tool called Application Verifier.

 

To troubleshoot follow the steps below to set this up:

Download and install Application Verifier:

 

Launch Application Verifier from the Start menu

Click File->Add Application

Navigate to the binary we need to set up verifier on and select it

Expand the Basics tree on the right

Uncheck everything except Locks

Right-click Locks and select Verifier Stop Options:

clip_image002

For each the Verifier Stop numbers, click on the number first, then ensure the Severity is set to “Error” and the button under “Error Reporting” is set to “Exception”, then click OK.

Note: You will need to re-enter the Verifier Stops menu by right-clicking Locks and clicking Verifier Stop Options for each stop number that is changed, for a total of 16 times.

clip_image004

Click Save

Restart the process and/or computer.

 

Related:

Application Verifier Locks 0x201 Active Critical Section
http://blogs.msdn.com/b/maartenb/archive/2008/10/16/application-verifier-locks-0x201-active-critical-section.aspx

 

For details about “Critical Sections”

Windows Internals 6th Edition Part 1 and Part 2.