Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Program and debugger quit without indication of problem

Tags:

I'm developing a WPF application. When debugging, the logic reaches a certain point, then the application quits for no reason. VS debugger catches nothing and the only indication of a problem is the following in the output window:

The program '[6228] SomeApp.vshost.exe: Managed (v4.0.30319)' has exited with code 1073741855 (0x4000001f).

When debugging the release version, or indeed running the debug build out of the debugger (in fact all combos that aren't running the debug version in debugger), everything works fine.

I'm trying to catch unhandled exceptions with the following code:

        AppDomain             .CurrentDomain             .UnhandledException +=             (sender, e) =>             {                 Debug.WriteLine("Unhandled Exception " + e.ExceptionObject);             };         Application             .Current             .DispatcherUnhandledException +=             (sender1, e1) =>             {                 Debug.WriteLine("DispatcherUnhandledException " + e1.Exception);             }; 

...but I'm not catching anything.

I'm considering peppering the app with debug output statements, but it's highly asynchronous so reading this will be both arduous and tedious.

How do I start figuring what is going on?

like image 950
spender Avatar asked Dec 26 '10 01:12

spender


People also ask

What does stop debugging do?

Stop Debugging terminates the process you are debugging if the program was launched from Visual Studio.

How do I stop just in time debugging pop ups?

In Windows Control Panel > Network and Internet > Internet Options, select Disable script debugging (Internet Explorer) and Disable script debugging (other).

How do I stop auto debugging in Visual Studio?

To end a debugging session in Microsoft Visual Studio, from the Debug menu, choose Stop Debugging.


2 Answers

According to ntstatus.h file, 0x4000001f (STATUS_WX86_BREAKPOINT) is an exception status code that is used by the Win32 x86 emulation subsystem. It (I suppose) means that you reached a breakpoint which is not exploitable. You should enable debugging unmanaged code.

like image 55
Vladimir Avatar answered Dec 03 '22 06:12

Vladimir


Using Visual Studio 2012 (Version 11.0.50727.1 RTMREL), the only solution I found was to go to Project -> Properties -> Debug and turn off "Enable the Visual Studio hosting process".

The option "Enable native code debugging" did not help even though I had all exceptions set to break-when-thrown.

Interestingly, this problem only started happening when I upgraded from VS2012 beta to the VS2012 official release.

like image 34
Ron Avatar answered Dec 03 '22 08:12

Ron