My game editor is written in c# and uses my native/unmanaged c++ engine DLL via c++/CLI via another managed c++ 'shim' that links in the c++ engine library. The c# editor pulls in a reference to the shim and creates 'wrapper' objects that wrap engine c++ objects.
I'm building my c++ engine DLL in x64 against DirectX9 and my shim and game editor are both also in x64 mode.
When I run the c# editor in debug mode or in release mode from within Visual Studio (2013), everything works fine and as expected. However, when I run the editor exe from explorer, sometimes it works but most of the time (8/10) it crashes. The crash is essentially "Editor has stopped working..." and Windows starts [hopelessly] looking for a solution.
I've removed parts of the code over and over and added logging to try and find where it's crashing but it's proving difficult.
My main question is, does anyone know of a good way to diagnose or see a stack trace from a process that has crashed in this way. I do get a Window asking if I want to debug, but when I do, it looks like the stack is deep in nt.dll somewhere. The debug error that pops up when starting the debug session, however, is:
"Unhandled exception at 0x00000000775FFFC2 (ntdll.dll) in GameEditor.exe: 0xC0000374: A heap has been corrupted (parameters: 0x0000000077677470).
If there is a handler for this exception, the program may be safely continued."
When I run the Release mode version from within Visual Studio, I turn on all exceptions and I don't see any. I have debug info built in with my release build so if there's anything obvious, I'd see it in the stack, but it's all external to my app.
I appreciate this might seem like me describing a haystack and asking you to find the needle but it's more about any tools I can use to diagnose the issue rather than what's causing it.