What are the causes and solutions of exception code c0000005 in mscorwks.dll?

Erick picture Erick · Dec 29, 2010 · Viewed 45k times · Source

The exception code C0000005 is thrown from mscorwks.dll when the application is run on Windows Server 2008 R2 launched using test complete. Other platforms (Windows XP, Server 2003 R2, Windows 7 32-bit and 64-bit) do not present this exception.

The event log from a single execution has many of the following event with event ID 1023 raised by the .NET Runtime:

.NET Runtime version 2.0.50727.4952 - Fatal Execution Engine Error (7383851A) (80131506)

The application itself makes use of a SOAP interface generated by Visual Studio from a WSDL file, a COM object with an embedded interop, and is targeting .NET 4.

sfc /scannow was run and found no problems with system files on the affected system.

What troubleshooting can be done to identify a solution?

Answer

Hans Passant picture Hans Passant · Dec 29, 2010

Fatal Engine Execution Error and an access violation are both symptoms of the same problem. FEEE is raised when the .NET garbage collector detects that the internal structure of the garbage collected heap is destroyed. An access violation is a hardware exception, raised by the processor when it is asked to access memory with an invalid address. A common cause of an AV is heap corruption.

These kind of mishaps are very commonly caused by unmanaged code. It is also quite common for unmanaged code to have latent memory management bugs that can go unnoticed for a long time. The kind of damage the bug can do tends to be quite random. Just running it on another operating system which has a different memory allocation pattern can be enough to trigger the bomb.

You have an excellent candidate for the source of the trouble. You'll need to work with the COM server vendor or author to chase the bug.