.Net 4.0 Windows 应用程序在 Windows Server 2008 下的 clr.dll 中崩溃

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5187898/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 08:08:37  来源:igfitidea点击:

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

windows.net-4.0crashclr

提问by Rez.Net

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

我有一个 Windows 应用程序计划每天运行,但由于 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:

在第二个 EventViewer 日志中,它说:

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).

服务器是 Win Server 2008 R2,应用程序使用 .Net 4.0(您也可以在错误日志中看到)。

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

该应用程序密集使用多线程,从远程数据库读取并写入本地硬盘。

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

对此问题的原因有任何猜测以及如何调查的任何帮助?我不知道在大约 5-10 小时的应用程序生命周期中它在哪里失败。

回答by Demir

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:

我有同样的问题。在大约 8-10 小时的应用寿命时,CLR 错误会上升。我怀疑我的非托管代码在后台线程中生成异常。但是,我无法真正找出原因。但是,您可以尝试以下操作:

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

如果您已经找到解决方案,请告诉我。

回答by gis

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

我有一个类似的问题,所以这可以帮助未来的用户找到解决方案:

We use Apache log4net for application log.

我们使用 Apache log4net 来记录应用程序日志。

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)

在更新到 DLL 版本 1.2.15 之后,对于 dotnet Framwork 4.5,一旦日志文件达到最大大小 (10MB),它就会开始触发这个确切的异常

回答by Persistence

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:

我的解决方案围绕我将 Lamda 传递给 P/Invoke 这一事实:

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

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