VirtualBox

Opened 11 years ago

Closed 8 years ago

#11855 closed defect (obsolete)

COM exceptions in IEventSource.GetEvent()

Reported by: rousseauhk Owned by:
Component: VM control Version: VirtualBox 4.2.12
Keywords: COM Cc:
Guest type: all Host type: Windows

Description

I run an event handler thread in a Windows Service to check for VM errors, and regularly get the following COM exceptions after running for a while (several hours):

COMException:-2147417848:The object invoked has disconnected from its clients. (Exception from HRESULT: 0x80010108 (RPC_E_DISCONNECTED))) at VirtualBox.IEventSource.GetEvent(IEventListener aListener,Int32 aTimeout)

COMException:-2147023174:The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)) at VirtualBox.IEventSource.UnregisterListener(VirtualBox.IEventListener)

The code is just a separate thread that does:

            //subscribe to all events
            VirtualBox.VirtualBox box = new VirtualBox.VirtualBox();
            IEventSource events = box.EventSource;
            IEventListener listener = events.CreateListener();

            try
            {

                VBoxEventType[] subscriptions = new VBoxEventType[] { VBoxEventType.VBoxEventType_Any };
                events.RegisterListener(listener, subscriptions, 0);

                //process events
                while (active)
                {
                    IEvent eventItem = events.GetEvent(listener, 10000);
                    if (eventItem != null)
                    {
                        ... 
                              // handle event
                        ... 
                        events.EventProcessed(listener, eventItem);
                    }
                }
            }
            catch (Exception e)
            {
                XLogger.Error("Fatal Error in VM event handler", e);
            }
            finally
            {
                //shutdown cleanly
                events.UnregisterListener(listener);
            }

There was no VM running at the time, so I havent attached any VM log. The machine in question is Win7 64-bit.

Attachments (1)

VBoxSVC.log (1.1 KB ) - added by rousseauhk 11 years ago.
vboxsvc.log

Download all attachments as: .zip

Change History (6)

by rousseauhk, 11 years ago

Attachment: VBoxSVC.log added

vboxsvc.log

comment:1 by rousseauhk, 11 years ago

I've attached the vboxsvc.log, but the error happened at 6/12/13 00:31am, and there is nothing in the logs at that time.

I do see some of these at other times - not sure if related or not:

00:06:06.025000 Watcher ERROR [COM]: aRC=E_ACCESSDENIED (0x80070005) aIID={3b2f08eb-b810-4715-bee0-bb06b9880ad2} aComponent={VirtualBox} aText={The object is not ready}, preserve=false

comment:2 by rousseauhk, 11 years ago

Just out of curiosity, I tried attaching the Visual Studio Express debugger to VBoxsvc, creating, starting and stopping a VM and then just running the event loop. This is what I got:

The thread 0xef0 has exited with code 0 (0x0).
The thread 0xf2c has exited with code 0 (0x0).
The thread 0xf58 has exited with code 0 (0x0).
First-chance exception at 0x000007FEFD919E5D (KernelBase.dll) in VBoxSVC.exe: 0x800706BA: The RPC server is unavailable.
The thread 0xf6c has exited with code 0 (0x0).
The thread 0x4b4 has exited with code 0 (0x0).
The thread 0xf18 has exited with code 0 (0x0).
The thread 0xbc4 has exited with code 0 (0x0).
First-chance exception at 0x000007FEFD919E5D (KernelBase.dll) in VBoxSVC.exe: 0x800706BA: The RPC server is unavailable.
First-chance exception at 0x000007FEFD919E5D (KernelBase.dll) in VBoxSVC.exe: 0x800706BA: The RPC server is unavailable.
First-chance exception at 0x000007FEFD919E5D (KernelBase.dll) in VBoxSVC.exe: 0x800706BA: The RPC server is unavailable.
The thread 0xe08 has exited with code 0 (0x0).
The thread 0xbf4 has exited with code 0 (0x0).
The thread 0xc44 has exited with code 0 (0x0).
The thread 0x71c has exited with code 0 (0x0).
The thread 0x5ec has exited with code 0 (0x0).
The thread 0x770 has exited with code 0 (0x0).
The thread 0x67c has exited with code 0 (0x0).
The thread 0xee4 has exited with code 0 (0x0).
The thread 0x304 has exited with code 0 (0x0).
The thread 0x390 has exited with code 0 (0x0).
The thread 0xcbc has exited with code 0 (0x0).
The thread 0x968 has exited with code 0 (0x0).
The thread 0xcc0 has exited with code 0 (0x0).
The thread 0xd98 has exited with code 0 (0x0).
The thread 0xfc0 has exited with code 0 (0x0).
The thread 0xc78 has exited with code 0 (0x0).
The thread 0x710 has exited with code -39 (0xffffffd9).
The thread 0xd94 has exited with code 0 (0x0).
The thread 0x988 has exited with code 0 (0x0).
The thread 0x50c has exited with code 0 (0x0).
The thread 0x648 has exited with code 0 (0x0).
The thread 0xc74 has exited with code 0 (0x0).
First-chance exception at 0x000007FEFD919E5D (KernelBase.dll) in VBoxSVC.exe: 0x80010108: The object invoked has disconnected from its clients.
First-chance exception at 0x000007FEFD919E5D (KernelBase.dll) in VBoxSVC.exe: 0x800706BA: The RPC server is unavailable.
First-chance exception at 0x000007FEFD919E5D (KernelBase.dll) in VBoxSVC.exe: 0x800706BA: The RPC server is unavailable.
First-chance exception at 0x000007FEFD919E5D (KernelBase.dll) in VBoxSVC.exe: 0x800706BA: The RPC server is unavailable.
'VBoxSVC.exe' (Win32): Unloaded 'C:\Windows\System32\wbem\fastprox.dll'
'VBoxSVC.exe' (Win32): Unloaded 'C:\Windows\System32\ntdsapi.dll'
'VBoxSVC.exe' (Win32): Unloaded 'C:\Windows\System32\wbem\wbemsvc.dll'
'VBoxSVC.exe' (Win32): Unloaded 'C:\Windows\System32\wbem\wbemprox.dll'
'VBoxSVC.exe' (Win32): Unloaded 'C:\Windows\System32\wbemcomn.dll'
'VBoxSVC.exe' (Win32): Unloaded 'C:\Windows\System32\netcfgx.dll'
The thread 0xd64 has exited with code 0 (0x0).
The thread 0x304 has exited with code 0 (0x0).
The thread 0xd24 has exited with code 0 (0x0).
The thread 0xc80 has exited with code 0 (0x0).
The thread 0xe3c has exited with code 0 (0x0).
The thread 0xfe4 has exited with code 0 (0x0).
The program '[2456] VBoxSVC.exe' has exited with code 0 (0x0).

Not sure if the frequent 'RPC server is unavailable' errors are expected or not. They dont seem to cause any problems for the app until the 'object invoked has disconnected from its clients' one appears - at which point my apps shuts down (as does VBoxSvc).

comment:3 by rousseauhk, 11 years ago

I changed the app to catch these COMExceptions and retry, and VBoxSvc still shuts down. Cant tell whether its the GetEvent() calls that kill VBoxSvc, or whether VBoxSvc was crashing first, and then the GetEvent reporting the error because VBoxSvc was already dead.

comment:4 by rousseauhk, 11 years ago

I now have this issue on multiple boxes: an AMD-FX 8350 running Win 7 64-bit, an i5-3330 running Win 7 64-bit and a different i5-3330 running Win 8 64-bit.

Its an intermittent problem - sometimes I can run for days without seeing it. Sometimes it just dies every time I run the app.

These errors are also sometimes (not always) accompanied by an InvalidCastException which is thrown inside GetEvent().

comment:5 by aeichner, 8 years ago

Resolution: obsolete
Status: newclosed

Please reopen if still relevant with a recent VirtualBox release.

Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use