Defrag Tools: #24 - WinDbg - Critical Sections
- Posted: Jan 21, 2013 at 10:24 AM
- 35,695 Views
- 10 Comments
Loading User Information from Channel 9
Something went wrong getting user information from Channel 9
Loading User Information from MSDN
Something went wrong getting user information from MSDN
Loading Visual Studio Achievements
Something went wrong getting the Visual Studio Achievements
Right click “Save as…”
In this episode of Defrag Tools, Andrew Richards, Chad Beeder and Larry Larsen continue looking at the Debugging Tools for Windows (in particular WinDbg). WinDbg is a debugger that supports user mode debugging of a process, or kernel mode debugging of a computer.
This installment goes over the commands used to diagnose a Critical Section hang in a user mode application. We start with an overview of the four synchronization primitives and then delve deep in to temporary hangs, orphaned Critical Sections and deadlocks. We use these commands:
Make sure you watch Defrag Tools Episode #1 and Defrag Tools Episode #23 for instructions on how to get the Debugging Tools for Windows and how to set the required environment variables for symbols and source code resolution.
Resources:
Critical Section Objects
Timeline:
[01:00] - Hang types - CPU Looping, Temporary Hangs and Permanent Hangs
[02:00] - Synchronization Objects - Event, Semaphore, Mutex, Critical Section
[06:54] - Critical Sections
[11:45] - Debugging a Hang
[28:08] - Debugging an Orphan
[32:40] - Debugging a Deadlock
Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation,
please create a new thread in our Forums,
or
Contact Us and let us know.
Follow the Discussion
Oops, something didn't work.
What does this mean?
Following an item on Channel 9 allows you to watch for new content and comments that you are interested in. You need to be signed in to Channel 9 to use this feature.What does this mean?
Following an item on Channel 9 allows you to watch for new content and comments that you are interested in and view them all on your notifications page.sign up for email notifications?
Where is the Defrag Show - when is it coming back???
@edi
maybe Gov has no time (Windows Blue)
Would you guys consider managed code analysis in future versions of Debug Tools. I think it provides much more value for real life scenarios for people watching show since majority of applications we deal on daily basis are managed code nowdays.
@gt65345: If you debug managed code, you'll find these fundamentals being used by the CLR to achieve the synchronization. After the next two episodes on sync objects, and handles in general, we'll tape a managed debugging episode to show the differences, and more commonly, the similarities. I actually mentioned this in next week's episode, which was taped this morning.
Thanks for the feedback.
@MagicAndre1981: based on the limited evidence in the stack, it looks like ComcastSecureBackupShareshell is to blame. Was the CS reallocated when it was referenced?
I also think this was the cause. WinDbg tells me this as cause:
The DLL is a bit older:
But the user hasn't replied back if this was the fix.
How come, in all these decades, MSFT haven't built a debugger that's a little easier to use? Like the ANTS tools from red-gate.
@gt65345: There's a pretty good show on .NET debugging with windbg http://channel9.msdn.com/Series/-NET-Debugging-Stater-Kit-for-the-Production-Environment
Won't complain if the Defrag Tools folks cover it in more detail as well though
@windev, are those crashing sample apps you have available? It might be useful to follow along and see if we get the same results (t'would confirm the debgging tools are set up properly on our boxes) and also play more with some of the scenarios you've demoed.
@JohnLudlow: I'll ask Larry how to get them on the C9 site for download. I have no issue releasing them. Email me at defragtools@microsoft.com and I'll send you the ZIP.
@JohnLudlow: We'll cover Managed Debugging at a high level in (near) future episode. For sure, watch the .NET Debugging series by Brad - it covers different command/techniques than what I'll go over.
Remove this comment
Remove this thread
close