none
.net Debugging Possible Finalizer Blocked Situation

    Question

  • Hi everybody

    This post is a continuation of another post I wrote on NET Framework  >  Common Language Runtime Internals and Architecture forum (https://social.msdn.microsoft.com/Forums/vstudio/en-US/e6285e2f-2c27-4516-afc7-4c3fafb3bada/net-web-application-hangs-when-finalizer-gets-blocked?forum=clr), and as moderator suggested me, I came up writing this post.

    The aim of this post is ask for help trying to figure out what happens inside .NET CLR at the moment of reported incident. I went not so far using windbg to find out root causes of this outage, and from now on I need to go beyond this limit and uncover the circumstances that produces this issue.

    Working with windbg I can see Finalizer stack, and the last operation I see is a wait, as you can see:

    ntdll!NtWaitForSingleObject+0xa
    KERNELBASE!WaitForSingleObjectEx+0x94
    clr!CLREventWaitHelper2+0x38
    clr!CLREventWaitHelper+0x1f
    clr!CLREventBase::WaitEx+0x63
    clr!SVR::WaitForFinalizerEvent+0x4e
    clr!SVR::GCHeap::FinalizerThreadWorker+0x4a
    clr!ManagedThreadBase_DispatchInner+0x2d
    clr!ManagedThreadBase_DispatchMiddle+0x6c
    clr!ManagedThreadBase_DispatchOuter+0x75
    clr!SVR::GCHeap::FinalizerThreadStart+0xd7
    clr!Thread::intermediateThreadProc+0x7d
    kernel32!BaseThreadInitThunk+0x22
    ntdll!RtlUserThreadStart+0x34

    As I mentioned in the original post, all threads are on "Preemptive" mode, and finalizer queue has over 50k of objects. Application becomes to hang and never get ride of it.

    How can I determine the root cause of this blocking (if it were the case) or some other cause of the application malfunction?

    Many thanks in advance


    Friday, August 10, 2018 3:28 PM