Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VShost32.exe stopped working, but I can continue debugging

Tags:

vb.net

My application first reads data from a database and then creates an XML document to be uploaded to a SFTP server.

When I run the application I get an error:

VShost32.exe stopped working

When I run the application in debug mode and step through it, I find the point where the error pops up, but I can still continue to step to the next steps (as long as I don't close the pop up). Then, everything that should be done, is done. No problems at all.

So why do I get this error message? It's completely unclear on what is causing it.

Also, How can I get rid of it?

like image 649
Eric Avatar asked Jan 17 '13 14:01

Eric


1 Answers

VSHost32.exe is the Visual Studio Hosting process. It has a custom-hosted version of the CLR that makes debugging easier. The actual process name is yourapp.vshost.exe, you can see it running in Task Manager.

So what the message really means is that your program has crashed, but not in way that the debugger can identify. Which is technically possible if the library you use starts its own unmanaged thread and that thread crashed on an unhandled exception. By default, the debugger can only diagnose exceptions that are raised on a thread started by managed code.

That you able to continue debugging after this crash is very unusual and potentially pretty unhealthy. This is technically possible if the library you use installs its own unhandled exception filter with SetUnhandledExceptionFilter() and swallows the exception. But does so after the hosting process has seen it. Which is pretty remarkable.

Get better diagnostics about this by enabling the unmanaged debugger. Project + Properties, Debug tab, tick the "Enable unmanaged code debugging" option. Then Debug + Exceptions, tick the Thrown checkbox for Win32 Exceptions. Repro the crash scenario, the debugger should now stop when the exception is thrown. Look at the call stack for hints. You are not going to be able to see much of anything recognizable since there probably isn't any debug info for the code that crashed. But hopefully the name of the DLL that contains the code lets you see what library is responsible for this. Then contact the vendor of the library and ask for details.

like image 167
Hans Passant Avatar answered Nov 27 '22 15:11

Hans Passant