VBoxService memory leak when DBUS is not running in the guest
|Reported by:||PeterB||Owned by:|
|Component:||guest additions||Version:||VirtualBox 4.3.20|
|Keywords:||VBoxService dbus vminfo||Cc:|
|Guest type:||Linux||Host type:||Linux|
VBoxService leaks memory with a rate of ca. 3 MB/day.
I have a minimal Linux guest VM (with no X installed) used as a simple server. With an uptime of 30 days I gradually reached a ~100 MB memory footprint for the VBoxService process (and increasing...)
Using GDB to analyze the heap of the VBoxService process, I tracked down the issue to be related to DBus, as the heap was _full_ of these strings:
Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory org.freedesktop.DBus.Error.FileNotFound
The error is understandable as I don't have DBus installed in the guest. The problem is that the error messages stay on the heap and don't get freed.
Digging further, I suspect that the problem is in VBoxServiceVMInfo.cpp: (line 798)
if ( pConnection && dbus_error_is_set(&dbErr)) dbus_error_free(&dbErr);
In my case pConnection is NULL, since the DBus connection attempt with dbus_bus_get() was not successfull. However, the dbErr buffer is filled in and will not be freed.
Please let me know if you need any more info.