Validating Message Parameters

Lawrence D'Oliveiro ldo at geek-central.gen.nz
Mon Aug 21 00:05:56 UTC 2017


On Sun, 20 Aug 2017 16:18:52 -0700, Thiago Macieira wrote:

> Or you get an assertion failure and your application crashes.

    python3 -ic "import dbussy as dbus"
    >>> m = dbus.Message.new_method_call(destination = "nosuch", path = "/", iface = "nosuch", method = "nosuch")
    process 5697: arguments to dbus_message_new_method_call() were incorrect, assertion "destination == NULL || _dbus_check_is_valid_bus_name (destination)" failed in file ../../../dbus/dbus-message.c line 1370.
    This is normally a bug in some application using the D-Bus library.
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/home/ldo/projects/dbussy/dbussy.py", line 3473, in new_method_call
        raise CallFailed("dbus_message_new_method_call")
    dbussy.CallFailed: dbus_message_new_method_call failed

Seems like libdbus prints a message, but does not abort.

So at the API level, you get back a failure indication without any hint
as to what actually was wrong.


More information about the dbus mailing list