[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-dbus
Subject:    Fatal warnings in client code
From:       "Thomas Kluyver" <thomas () kluyver ! me ! uk>
Date:       2023-03-06 12:20:05
Message-ID: f3941014-d8c9-402c-887a-b13c71bacc1b () app ! fastmail ! com
[Download RAW message or body]

Hi all,

I helped someone work around VLC crashing when it tried to create a D-Bus message \
with a string that was not UTF-8 (probably loaded from a file without checking the \
encoding). The workaround was to set the environment variable DBUS_FATAL_WARNINGS=0 \
when running VLC.

There are a couple of similar issues on the VLC issue tracker, where a maintainer is \
adamant (and quite forthright) that this is a bug in libdbus:

https://code.videolan.org/videolan/vlc/-/issues/8390
https://code.videolan.org/videolan/vlc/-/issues/21354

I disagree with his reasoning (he says that the sender shouldn't validate messages), \
but it seems drastic for library code to call abort() and crash the entire \
application. Is this the intended behaviour, or has the application or the distro \
misconfigured something somewhere along the way?

The docs for the function in question say that it can return false if there's not \
enough memory, but don't mention any other failure conditions:

https://dbus.freedesktop.org/doc/api/html/group__DBusMessage.html#ga17491f3b75b3203f6fc47dcc2e3b221b


In terms of implementation, the public function calls _dbus_return_val_if_fail, which \
is a macro wrapping _dbus_warn_return_if_fail, which calls _dbus_warn_check_failed. \
The comment for that last function mentions 'Calling this means "there is a bug"' - \
should that mean only bugs in dbus itself, or also bugs in application code using it?

Thanks,
Thomas


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic