DialogDebuggerVisualizer: COMException: Object is in a zombie state

4

On the first time in a debugging session that I try to show the visualizer, it raises that exception (appears at the bottom), I click "Continue" on the exception message dialog and show again the visualizer (by clicking on the "magnifying glass icon next to the variable). This is the simple visualizer that I have:

[assembly: DebuggerVisualizer(
    typeof(TestVisualizer),
    Target = typeof (string),
    Description = "Test Visualizer")]

namespace VuTree {
    public class TestVisualizer : DialogDebuggerVisualizer {
        protected override void Show(IDialogVisualizerService svc, IVisualizerObjectProvider provider) {
            var text = provider.GetObject() as string ?? "no object found...";
            using (var form = new Form())
            {
                form.Text = text;
                form.Size = new Size(400, 400);
                svc.ShowDialog(form);
            }
        }
    }
}

This is (part of) the exception:

************** Exception Text **************
System.Runtime.InteropServices.COMException (0x8013134F): Object is in a zombie state. (Exception from HRESULT: 0x8013134F)

Server stack trace: 
   at Microsoft.VisualStudio.DebuggerVisualizers.DebugViewerShim.IPropertyProxyEESide.InitSourceDataProvider(IEEDataStorage& data)
   at Microsoft.VisualStudio.DebuggerVisualizers.DebugViewerShim.ManagedShim.SafeProxyWrapper.InitSourceDataProvider()
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [0]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at Microsoft.VisualStudio.DebuggerVisualizers.DebugViewerShim.ManagedShim.SafeProxyWrapper.InitSourceDataProvider()
   at Microsoft.VisualStudio.DebuggerVisualizers.DebugViewerShim.ManagedShim.DelegatedHost.CreateViewer(IntPtr hwnd, HostServicesHelper hsh, SafeProxyWrapper proxy)

Why does it happen? how to resolve it?

c#
visual-studio-2012
comexception
debuggervisualizer
asked on Stack Overflow Dec 22, 2013 by Tar

1 Answer

3

In general, zombie state is the state when a thread that was previously started (by another thread) finally finished it's work, but it didn't return the control to the calling thread that created it, which means it's doing nothing but still alive somewhere, this is why they call is zombie because it is supposed to come back and end its lifespan but it didn't either come back or die. So far, this exception has been appearing to me only when I'm debugging, I saw it with web apps, desktop, win apps..etc, all it takes to solve it is to restart the application. This will free up all allocated resources and everything should be back to normal. Last time I encountered this exception was when I was debugging a web application that's hosted in IIS after attaching the debugger to the w3wp.exe process (app pool).

answered on Stack Overflow Feb 6, 2017 by Mohammed Al Banna

User contributions licensed under CC BY-SA 3.0