Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.Net 4.0 Windows Application crashes in clr.dll under Windows Server 2008

I have a Windows application scheduled to run on a daily basis and fails intermittently as per the following log in EventViewer.

Faulting application name: MyApplication.exe, version: 1.0.0.0, time stamp: 0x4d54829a
Faulting module name: clr.dll, version: 4.0.30319.1, time stamp: 0x4ba21eeb
Exception code: 0xc0000005
Fault offset: 0x00000000000029e1
Faulting process id: 0xbb1c
Faulting application start time: 0x01cbd99223d8b4eb
Faulting application path: E:\MyApplication\MyApplication.exe
Faulting module path: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
Report Id: 7e74ec7e-45a5-11e0-a95d-003048de380d

And in the second EventViewer log it says:

The process was terminated due to an internal error in the .NET Runtime at IP 000007FEF97329E1 (000007FEF9730000) with exit code 80131506.

The server is Win Server 2008 R2 and the application uses .Net 4.0 (as you can see in the error log too).

The application uses multi-threading intensively and reads from a remote database and writes to local hard disk.

Any guesses on what causes this issue and any suggestions on how to investigate? I have no idea where it fails in the life of the application which is about 5-10 hours.

like image 997
Rez.Net Avatar asked Mar 03 '11 23:03

Rez.Net


3 Answers

I'm having the same issue. At approximately 8-10 hours of application life CLR error rises. I suspected my unmanaged code generating exception in the background thread. However I could not really find out why. You can give the following a try however:

  • If you are using unmanaged code review exception handling statements while executig it.
  • Make sure you have the latest fixes of .NET4.
    (https://connect.microsoft.com/VisualStudio/Downloads)

Please let me know if you have already found a solution.

like image 195
Demir Avatar answered Oct 14 '22 04:10

Demir


I had a similar problem, so this can help future user to find a solution :

We use Apache log4net for application log.

After an update to DLL version 1.2.15, for dotnet Framwork 4.5 it starts to fire this exact exception once the log file reach the maximal size (10MB)

like image 38
gis Avatar answered Oct 14 '22 05:10

gis


The hot-fix has mostly vanished and I faced a similar issue, so I'll share my answer here.

My solution revolved around the fact that I was passing a Lamda to a P/Invoke:

https://stackoverflow.com/a/52360307/4700841

like image 22
Persistence Avatar answered Oct 14 '22 04:10

Persistence