Newbie question: dbus_bus_get() and dbus_error_is_set()

Simon McVittie simon.mcvittie at collabora.co.uk
Wed Apr 6 08:27:27 PDT 2011


On Wed, 06 Apr 2011 at 16:29:52 +0200, Dan Arrhenius wrote:
> process 22264: arguments to internal_bus_get() were incorrect,
> assertion "type >= 0 && type < N_BUS_TYPES" failed in file
> dbus-bus.c line 434.
> This is normally a bug in some application using the D-Bus library.

This is normally a bug in ... you get the idea :-)

These warnings are analogous to g_return_if_fail in GLib, indicating that
the library user is using it wrong. Quoting from the GLib documentation:

    The program behavior is generally considered undefined after one of
    these checks fails. They are not intended for normal control flow,
    only to give a perhaps-helpful warning before giving up.

In libdbus they're fatal by default. Debian and derivatives (e.g. Ubuntu)
have a patch to make these warnings default to not being fatal, which is
probably why you're not seeing a SIGABRT.

Contrastingly, DBusError is analogous to GError, which deals with runtime
errors (file not found, failed to parse input or whatever).

    S


More information about the dbus mailing list