libdbus : 495: assertion failed "!(connection)->have_connection_lock" file "external/dbus/dbus/dbus-connection.c

Simon McVittie simon.mcvittie at collabora.co.uk
Fri Mar 30 04:40:06 PDT 2012


On 29/03/12 22:04, Ankit Verma wrote:
> I am getting this assertion failure causing a crash on a android mobile
> phone using DBUS 1.4.0.

D-Bus 1.4.0 is pretty old; the current stable release is 1.4.20 (and the
current development release is 1.5.12). I recommend at least using the
current stable release - the purpose of the 1.4.x branch is to fix bugs
without introducing new features or other destabilizing changes.

First, make sure you're calling dbus_threads_init_default() (or
dbus_threads_init()) if you're using multiple threads. libdbus needs
explicit threading initialization, because it requires memory
allocation, and libdbus policy is to treat memory allocation failures as
non-fatal; that can't happen if threading is initialized implicitly.

If that doesn't solve your problem, please describe your thread usage
pattern: how many threads do you have and how are they using D-Bus? Are
any of them sharing a single DBusConnection between multiple threads?

D-Bus 1.5.10 included a major change to how recursive mutexes work,
which fixes unpredictable crashes when using multi-threading extensively
(previously, they were mis-implemented on Unix systems), but is itself
quite a major change. Try 1.5.x if 1.4.x doesn't work for you. The
relevant commits reference bug #43744, but to be honest you'd be better
off updating to a tested release than backporting so many things.

    S


More information about the dbus mailing list