System.ExecutionEngineException失败 [英] System.ExecutionEngineException Failure
问题描述
我知道这个问题是非常广泛的,因为我确定这个错误可能有多个原因,所以我会尽量缩小一点。
我是在VS2003中开发使用C ++ .NET的应用程序
该应用程序主要使用非托管代码和少量托管代码(由于垃圾收集器的严重干扰)。所以我会评价95%的非管理,5%的管理
我读过某个不稳定/错误/不正确的非托管代码可能会混乱部分CLR内存渲染它损坏并抛出此错误。
由于95%的应用程序是不管理的,我不知道从哪里开始查找。
可能是被管理和非托管之间交互的几个类?
将数据从管理编组到非托管?
可以使一个坏的空指针导致此失败?
还有什么其他问题可以导致这个?数组索引超出范围?一个空对象呢?
任何可以给System.ExecutionEngine失败的可能原因列表的信息/论文/文章将不胜感激!
根据答案,这种异常可能在多种情况下引起,提及htem在答案中更好地了解。
可能的原因/方案列表 -
- C ++和C#之间的参数不匹配
- 使用反射
- WCF服务尝试返回IList或IEnumerable 此处 此处
- 使用分析工具
- 汇编程序中使用std指令
- < a href =https://stackoverflow.com/a/3385174/45382>多次呼叫:: FreeLibrary()
- .NET剪贴板电话
- 使用Unity框架
- 使用错误的编组
- 使用
INotifyPropertyChanged
可能的解决方法/解决方案 -
这不应该太重视,但我设法得到这个例外,同时有一些有趣的反思:
code> typeof(IntPtr).GetField(Zero)。SetValue(null,new IntPtr(666));
I've been trying to find out more about this problem and I'm not having much luck. I keep reading that applications should not have this error come up and although that's all fine and dandy, it doesn't tell me what can cause this error to show up.
I know this question is very broad as I'm sure there can be multiple causes for this error so I'll try to narrow it down a bit.
I'm working in VS2003 developing an application that uses C++.NET
The application uses mostly unmanaged code and little managed code (due to heavy interference by the garbage collector). So I'd rate it 95% unmanaged, 5% managed
I've read somewhere that unstable/buggy/incorrect unmanaged code can mess up parts of the CLR memory rendering it corrupt and throwing this error.
Since 95% of the application is unmanaged, I'm not sure where to start looking. Maybe the few classes that interact between managed and unmanaged? What about marshalling data from managed to unmanaged? Can a bad null pointer cause this failure? What other problems can cause this? Array Index out of bounds? What about a Null Object?
Any information/paper/article that can give a nice list of possible causes for the System.ExecutionEngine failure would be appreciated!
Based on answers this exception can be caused in multiple scenarios, mentioning htem in answer for better visibility.
List of possible causes/scenarios -
- Argument mismatch between C++ and C#
- While using reflection
- WCF service tries to return an IList or IEnumerable here here
- Using Profiling tools
- using the std instruction in assembler
- calling ::FreeLibrary() multiple times
- .NET Clipboard calls
- using the Unity Framework
- Using the wrong marshaling
- Using
INotifyPropertyChanged
Possible workarounds/solutions -
This should not be taken too seriously, but I managed to get this exception while having some fun with reflection:
typeof(IntPtr).GetField("Zero").SetValue(null, new IntPtr(666));
这篇关于System.ExecutionEngineException失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!