Defrag Tools: #24 - WinDbg - Critical Sections

Play Defrag Tools: #24 - WinDbg - Critical Sections

The Discussion

  • User profile image

    Where is the Defrag Show - when is it coming back???

  • User profile image

    Big Smile today I also debugged a Explorer crash causes by a wrong cs usage in the technet forums Big Smile

    0:033> !cs -s 000000001a496f50
    Critical section   = 0x000000001a496f50 (+0x1A496F50)
    DebugInfo          = 0x0000000013c9bee0
    LockCount          = 0x0
    WaiterWoken        = No
    OwningThread       = 0x0000000000001b04
    RecursionCount     = 0x1
    LockSemaphore      = 0x0
    SpinCount          = 0x00000000020007d0
    Stack trace for DebugInfo = 0x0000000013c9bee0:
    0x000007fbd4bf0410: ntdll! ?? ::FNODOBFM::`string'+0x7E91
    0x000007fbcf385be5: verifier!AVrfpInitializeCriticalSectionCommon+0x115
    0x000000018012f76b: ComcastSecureBackupShareshell!DllUnregisterServer+0x12C45B
    0x0000000180002a7b: ComcastSecureBackupShareshell+0x2A7B
    0x000000018000302a: ComcastSecureBackupShareshell+0x302A
    0x00000001801a9b4b: ComcastSecureBackupShareshell!DllUnregisterServer+0x1A683B
    0x000007fbcf383b2e: verifier!AVrfpStandardDllEntryPointRoutine+0xBE
    0x000007fbd4afba0e: ntdll!LdrpCallInitRoutine+0x3E
    0x000007fbd4b182dc: ntdll!LdrpInitializeNode+0x192
    0x000007fbd4b1787f: ntdll!LdrpInitializeGraph+0x6F
    0x000007fbd4b19202: ntdll!LdrpPrepareModuleForExecution+0x1A5
    0x000007fbd4b19af2: ntdll!LdrpLoadDll+0x344
    0x000007fbd4b0e08b: ntdll!LdrLoadDll+0xA7
    0x000007fbcf383ff6: verifier!AVrfpLdrLoadDll+0x76
    0x000007fbd1aef653: KERNELBASE!LoadLibraryExW+0xBF
    0x000007fbd355296c: combase!LoadLibraryWithLogging+0x2C
    0x000007fbd35528c4: combase!CClassCache::CDllPathEntry::LoadDll+0x70
    0x000007fbd3552693: combase!CClassCache::CDllPathEntry::Create+0x43
    0x000007fbd35522a0: combase!CClassCache::CClassEntry::CreateDllClassEntry+0x196
    0x000007fbd3552238: combase!CClassCache::GetClassObjectActivator+0x932


    maybe Gov has no time (Windows Blue)


  • User profile image

    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.

  • User profile image

    @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.

  • User profile image

    @MagicAndre1981: based on the limited evidence in the stack, it looks like ComcastSecureBackupShareshell is to blame. Was the CS reallocated when it was referenced?

  • User profile image

    @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:

    APPLICATION_VERIFIER_LOCKS_EXIT_THREAD_OWNS_LOCK (200)Thread cannot own a critical section.This stop is generated if a thread (thread ID is parameter1) is terminated, suspended or is in a state (worker thread finished a work item) in which it cannot hold a critical section.


    The DLL is a bit older:

        Loaded symbol image file: ComcastSecureBackupShareshell.dll    Image path: C:\Program Files\SecureBackupShare\ComcastSecureBackupShareshell.dll    Image name: ComcastSecureBackupShareshell.dll    Timestamp:        Mon Nov 08 23:47:33 2010 (4CD87E05)    CheckSum:         00426F0D    ImageSize:        00450000    File version:    Product version:    File flags:       0 (Mask 3F)    File OS:          40004 NT Win32    File type:        2.0 Dll    File date:        01CCBBA5.094B4C4D    Translations:     0009.04b0    CompanyName:      Secure Backup and Share    ProductName:      Secure Backup and Share    InternalName:     x64_shell.dll    ProductVersion:    FileVersion:    FileDescription:  Secure Backup and Share Shell Extensions    LegalCopyright:   Copyright © 2010


    But the user hasn't replied back if this was the fix.


  • User profile image

    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.

  • User profile image

    @gt65345: There's a pretty good show on .NET debugging with windbg

    Won't complain if the Defrag Tools folks cover it in more detail as well though Smiley

    @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.

  • User profile image

    @JohnLudlow: I'll ask Larry how to get them on the C9 site for download. I have no issue releasing them. Email me at and I'll send you the ZIP.

  • User profile image

    @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.

Add Your 2 Cents