Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Runtime fatal error - possibly CLR bug

I would like some insight into an error I'm receiving:

Managed Debugging Assistant 'FatalExecutionEngineError' has detected a problem in 'C:\app.exe'. Additional Information: The runtime has encountered a fatal error... This error may be a bug in the CLR or in the unsafe or non-verifiable portions of the user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack."

I would like to understand not only the error itself, but what/how CLR may play a part, and I've never really heard of COM-intercop or PInvoke are.. so some insight into those would also be helpful.

Also, the really odd part of it all is that if I continue through the breakpoints and do not step into or over, I do not see the error. However, if I step through line by line, the error pops up! Can anyone explain why I only see it while stepping through?

Not sure what other information would be useful.. please let me know (nicely of course!) what I could add.

Thank you in advance! :)

like image 587
developer Avatar asked Feb 15 '11 22:02

developer


2 Answers

I ran into this working on a Dotnet Core project. I deleted the binaries and rebuilt, this fixed it for me. Simply doing a Clean and Build or just Rebuild had no effect.

like image 102
Bob Sakson Avatar answered Oct 19 '22 04:10

Bob Sakson


It's most likely not a CLR bug, but probably a Heisenbug. We can't really say what's causing it, though, without seeing your code.

Try turning on Managed Debugging Assistants to figure out if some error or access violation is being suppressed.

like image 39
user541686 Avatar answered Oct 19 '22 03:10

user541686