.net web application hangs when finalizer gets blocked

326 views Asked by At

We have one application runnnig for more a year, and and since 2 months ago it becomes to hang. In the meanwhile we're able to get two dumps of the hung process, and te results were analyzed by debugdiag, telling us that we must suspect of finalizer thread blocked.

Starting from information provided by debugdiag, and by mean of windbg, we checked the following cirumstances at the moment of chrash: - All threads are on Preemptive mode - Finalizer's stack shows ntdll!NtWaitForMultipleObjects+a or ntdll!NtWaitForSingleObject+a

Application is using managed code, but on "Previous .NET Exceptions Report (Exceptions in all .NET Heaps)" section of debugdiag result, we can see System.ExecutionEngineException out of another exceptions tha are suspicious. For example System.OutOfMemoryException and System.StackOverflowException. These only appear once, but could be related to blocked finalizer (or not??)

Some data about environment

  • CLR Version 4.0.30319.36440
  • Operating System Windows Server 2012 R2
  • Number Of Processors 4
  • Process Bitness 64-Bit
  • Processor Type X64

Finalizer thread stack looks like this:

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

We've spent a lot of time trying to figure out what is happening here, but with no success, we followed several related post too, everything was unuseful.

Could someone give us a hint on this issue?

Many thanks in advance

0

There are 0 answers