[Libreoffice-commits] D-Bus is not thread safe

Michael Meeks michael.meeks at collabora.com
Tue Oct 15 12:46:46 CEST 2013


On Tue, 2013-10-15 at 10:20 +0200, Stephan Bergmann wrote:
> With the below commit I do not get any spurious D-Bus-related crashes 
> during startup of "soffice --impress" of my (--enable-avahi 
> --enable-dbus) Linux build any more, but I still get

	Looks perfect - thanks for that Stephan ! :-)

> >      are in D-Bus's internal_bus_get simultaneously (with disastrous consequences,
> >      like SEGV) despite the _DBUS_LOCK(bus) there, unless you previously called

	The people most acquainted with dbus claim that despite the locking it
is not thread-safe either [ much like LibreOffice I guess ;-].
Unfortunately, I suspect it's not terribly easy to protect it with our
own mutexes either - IIRC gio (used in the file-selector) and dconf for
configuration (as/when/if) have some degree of dbus usage too.

> >      Other places that (indirectly) use D-Bus (tubes/source/file-transfer-helper.c,
> >      vcl/generic/fontmanager/fontconfig.cxx, vcl/unx/gtk/window/gtksalframe.cxx might
> >      need this, too.

	Quite likely. AFAICS we should prolly do this really early in the VCL
backend initialization if #ifdef ENABLE_DBUS is true (or any of these
other conditionals) ? the earlier the safer I suspect.

	ATB,

		Michael.

-- 
 michael.meeks at collabora.com  <><, Pseudo Engineer, itinerant idiot



More information about the LibreOffice mailing list