The app in question uses both native and managed code. The managed code provides just the UI layer while it links with a native dll which performs bulk of operations. The native dll links with some other static dlls. Now the issue is when I run the app it crashes non-deterministically. When I debug the app under managed code debugging, it shows that a particular function in the native code threw an "SEH" Exception. Stack trace just shows the current function. The error code that I get in the SEH Exception is EFAIL. However the app runs fine every time under native debugger. The function which throws the SEH exception is single threaded. It doesn't uses any resources which may be accessed in any other thread. What could be the possible cause for this behavior? How should I go about detecting the origin of the exception in native code. Stepping-in under the debugger doesn't helps since the issue doesn't shows up when the app is running under the debugger.
I am using visual studio 2012.