#994158 bt-adapter (and other bluetooth tools) throws assertions failed rather than user-understandable errors if bluetoothd not running or no host adapter present

Package:
bluez-tools
Source:
bluez-tools
Description:
Set of tools to manage Bluetooth devices for linux
Submitter:
Alain Knaff
Date:
2021-09-12 22:39:03 UTC
Severity:
normal
#994158#5
Date:
2021-09-12 22:29:31 UTC
From:
To:
Hi,

bt-adapter -i fails assertions when attempting to start it without
bluetoothd running, or no host adapter present.


If bluetoothd is not running, it waits a long while (why? It's a TCP
connection, which should fail immediately), and finally throws following
assertion failed:

**
ERROR:lib/helpers.c:319:intf_supported: assertion failed: (introspection_proxy != NULL)
Bail out! ERROR:lib/helpers.c:319:intf_supported: assertion failed: (introspection_proxy != NULL)
Aborted


If bluetoothd *is* running, but no hostadapter (HCI) present, it throws
the following assertion:

**
ERROR:lib/bluez/adapter.c:165:adapter_get_dbus_object_path: assertion failed: (ADAPTER_IS(self))
Bail out! ERROR:lib/bluez/adapter.c:165:adapter_get_dbus_object_path: assertion failed: (ADAPTER_IS(self))
Aborted

Normally, assertions should only be thrown for *internal* bugs in the
application, but not for external conditions (such as services or
hardware not present). For the user it would be much more obvious if it
plainly said something to the effect of "Bluetoothd service not running"
or "No Bluetooth Host Adapter (HCI) found"

Thanks,

Alain