[vbox-dev] Unreliability in guestcontrol

Andreas Löffler andreas.loeffler at oracle.com
Mon Jul 16 12:47:47 PDT 2012

Hi Brian,

thanks for the patches. For the guest control functionality there's a 
major overhaul with also a new API coming up, which (hopefully) will be 
in the next upcoming major VBox release. That said, the existing guest 
control API will be marked as being deprecated soon in order to give 
users a chance to switch to the new API.

Regarding VBoxService, as you already pointed out, there's also the need 
of fixing things here and there. Due to the lack of time VBoxService 
won't get any bigger treatment until then. I'll take a look at your 
patches when time permits. Please don't forget to state which license 
your patches apply to. Thanks!


On 16.07.2012 11:15, Brian Campbell wrote:
> Hi,
> I've been looking at using guest control for some automation, and I've
> encountered some problems that make the guest control part of the
> VBoxService daemon stop working. It's easy to reproduce this by using
> guestcontrol to execute /bin/true lots of times in a loop.
> The root cause appears to be that after one request is handled by the
> per-process thread, the main guest control thread in VBoxService can set
> up another request before the per-process thread expects one. Two
> problems appear because of this:
> 1. Occasionally the per-process thread will wipe out the request pointer
> after it has already been updated to the new request, so the new request
> is never processed. If you're logging you see a "IPC request is invalid"
> message instead. This is easily solved by moving the assignment before
> the code to wake up the main thread.
> 2. When the per-process thread realises it can shut down, if the main
> thread produces another request it will deadlock when the per-process
> thread attempts to enter a critical section. Fixing the deadlock isn't
> enough because it still won't process the request. I've worked around
> this by making the per-process thread set the shutdown flag and continue
> iterating through the main loop until it's sure that there's no request.
> I've attached a patch with these changes, although I think the way that
> guest control is implemented in VBoxService may need to be revisited -
> it seems a little confused and fragile, and my change for 2 is a bit of
> a hack. Also, there's a memory leak that I haven't tried to diagnose.
> Best regards,
> Brian Campbell
> _______________________________________________
> vbox-dev mailing list
> vbox-dev at virtualbox.org
> https://www.virtualbox.org/mailman/listinfo/vbox-dev

Kind regards / Mit freundlichen Grüßen

Andreas Löffler          | VirtualBox Engineering
Senior Software Engineer | Oracle Virtualization

ORACLE Deutschland B.V. & Co. KG
Werkstrasse 24
D-71384 Weinstadt, Germany

Hauptverwaltung: Riesstr. 25, D-80992 München
Registergericht: Amtsgericht München, HRA 95603
Geschäftsführer: Jürgen Kunz

Komplementärin: ORACLE Deutschland Verwaltung B.V.
Hertogswetering 163/167, 3543 AS Utrecht, Niederlande
Handelsregister der Handelskammer Midden-Niederlande, Nr. 30143697
Geschäftsführer: Alexander van der Ven, Astrid Kepper, Val Maher

More information about the vbox-dev mailing list