How to debug System.ExecutionEngineException in a framework code of a managed application

2

I have an application running as service. The application crashes time to time. The application is written in vb.net and runs its tasks at new thread (one at time). I have collected crash dumps and started analyzing. From analyze of log file created by the application (analysis of dump supports it) it seems that a crash occurs when no task is running and application is waiting for a next System.Timers.Timer event.

First I loaded a .dmp file to VS2010:

Process Architecture:   x86
Exception Code: 0xC0000005
Exception Information:  The thread tried to read from or write to a virtual address for which it does not have the appropriate access.
Heap Information:   Present

When I started 'Debug with mixed' I have got

An unhandled exception of type 'System.ExecutionEngineException' occurred in Unknown Module.

When searching web for more information I found that cdb.exe can give more information. Here is (shortened hopefully not too much) result of !analyze -v:

FAULTING_IP:
clr!GCPreempNoDtor::Enter+23
73532ac0 c7410800000000  mov     dword ptr [ecx+8],0    
EXCEPTION_RECORD:  ffffffff -- (.exr 0xffffffffffffffff)
ExceptionAddress: 73532ac0 (clr!GCPreempNoDtor::Enter+0x00000023)
   ExceptionCode: c0000005 (Access violation)
  ExceptionFlags: 00000001
NumberParameters: 2
   Parameter[0]: 00000001
   Parameter[1]: 764a125a
Attempt to write to address 764a125a

...

ERROR_CODE: (NTSTATUS) 0xc0000005 - The instruction at 0x%08lx referenced memory at 0x%08lx. The memory could not be %s.

MANAGED_STACK: !dumpstack -EE gives empty result.

STACK_TEXT:
0570f1b8 73635252 00000001 25d0418f 00070007 clr!GCPreempNoDtor::Enter+0x23
0570f1fc 73625e51 25d0424f 7359f550 00000000 clr!DestroyThread+0x82
0570f264 735ca0cf 00000000 00020000 0570f290 clr!ThreadpoolMgr::WorkerThreadStart+0x5b2
0570ff08 764a33aa 072cab38 0570ff54 77379ef2 clr!Thread::intermediateThreadProc+0x4d
0570ff14 77379ef2 072cab38 40118862 00000000 kernel32!BaseThreadInitThunk+0xe
0570ff54 77379ec5 735ca086 072cab38 ffffffff ntdll!__RtlUserThreadStart+0x70
0570ff6c 00000000 735ca086 072cab38 00000000 ntdll!_RtlUserThreadStart+0x1b

From this I conclude that the crash is cause by a CLR invoked process (Garbage Collection?) but I do not see any connection with my managed code and what to look for next.

.net
visual-studio-2010
debugging
unmanaged
crash-dumps
asked on Stack Overflow Aug 28, 2013 by IvanH

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0