Catching EngineExecutionException

左心房为你撑大大i 提交于 2019-12-21 17:51:47

问题


I have an application containing both managed and native code. The application currently has an unhandled exception filter, set via SetUnhandledExceptionFilter, which catches any critical errors, generates a minidump, records various application parameters, and exits the program.

The unhandled exception handler does not catch an EngineExecutionException which occurs in the .NET runtime. We suspect the problem is memory corruption caused by the native portion of the application.

The problem is, when the exception occurs, the application just exits without a trace. We'd like to record a minidump when this happens. Does anyone know how our application can install a handler capable of catching this?


回答1:


AFAIK this exception is not catchable on the managed side of things (at least not in .NET 4).

One way to "catch" it would be to create a (native) custom starter/loader for your application which loads the .NET runtime - this custom starter can install an exception handler on the native side of .NET runtime.

Reference links:

  • http://msdn.microsoft.com/en-us/magazine/cc163567.aspx
  • http://msdn.microsoft.com/en-us/library/ms164336.aspx
  • http://msdn.microsoft.com/en-us/library/dd380851.aspx
  • http://msdn.microsoft.com/en-us/library/ms231221.aspx


来源:https://stackoverflow.com/questions/9182387/catching-engineexecutionexception

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!