Bug 257034 - print/hplip: dbus abort in libsane-hpaio (without dbus and/or avahi running)
Summary: print/hplip: dbus abort in libsane-hpaio (without dbus and/or avahi running)
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
Depends on:
Reported: 2021-07-07 00:02 UTC by Ed Maste
Modified: 2021-07-11 23:08 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (tijl)


Note You need to log in before you can comment on or make changes to this bug.
Description Ed Maste freebsd_committer 2021-07-07 00:02:18 UTC
Attempting to run `scanimage -L` produced:

Process 12178 launched: '/usr/local/bin/scanimage' (x86_64)
dbus[12178]: arguments to dbus_connection_send() were incorrect, assertion "connection != NULL" failed in file dbus-connection.c line 3311.
This is normally a bug in some application using the D-Bus library.

  D-Bus not built with -rdynamic so unable to print a backtrace

Backtrace shows:

(lldb) bt
* thread #1, name = 'scanimage', stop reason = signal SIGABRT
  * frame #0: 0x0000000806dd3c5a libc.so.7`__sys_thr_kill at thr_kill.S:4
    frame #1: 0x0000000806d489d4 libc.so.7`__raise(s=6) at raise.c:52:10
    frame #2: 0x0000000806dfd899 libc.so.7`abort at abort.c:67:8
    frame #3: 0x0000000825e2abbc libdbus-1.so.3`_dbus_abort + 92
    frame #4: 0x0000000825e1f90f libdbus-1.so.3`_dbus_warn_check_failed + 335
    frame #5: 0x0000000825e02761 libdbus-1.so.3`dbus_connection_send + 177
    frame #6: 0x000000085fd37764 libsane-hpaio.so.1`___lldb_unnamed_symbol57$$libsane-hpaio.so.1 + 324
    frame #7: 0x000000085fd31d46 libsane-hpaio.so.1`___lldb_unnamed_symbol2$$libsane-hpaio.so.1 + 566
    frame #8: 0x000000085fd31ad9 libsane-hpaio.so.1`sane_hpaio_get_devices + 73
    frame #9: 0x0000000801b89a3d libsane.so.1`sane_dll_get_devices + 221
    frame #10: 0x00000000002079dd scanimage`___lldb_unnamed_symbol1$$scanimage + 7965
    frame #11: 0x00000000002058d0 scanimage`___lldb_unnamed_symbol21$$scanimage + 256

I don't have an hp scanner so just deleted /usr/local/lib/sane/libsane-hpaio.so* for now but will try to come back and investigate further later on.
Comment 1 Ed Maste freebsd_committer 2021-07-07 00:05:43 UTC
Observed with sane-backends-1.0.32_4 on (approximately) FreeBSD 13.0
Comment 3 VVD 2021-07-07 10:13:14 UTC
Do you ask to make AVAHI OFF by default?
Comment 4 Ed Maste freebsd_committer 2021-07-07 16:38:55 UTC
> Do you ask to make AVAHI OFF by default?

No, I think having the AVAHI option on by default is reasonable.

Your comment and some more searching suggests that the segfault is a consequence of not having dbus & avahi active. This seems like an upstream bug, hpaio should just remain inactive if dbus or avahi is not available.

IMO the avahi dependency ought to be mentioned in pkg-message though, because the failure mode is a non-obvious segfault and because avahi isn't actually needed (for the scanner backend).
Comment 5 VVD 2021-07-07 16:44:10 UTC
(In reply to Ed Maste from comment #4)
Can you please help me with pkg-message?
My english is poor. :-(
Comment 6 Ed Maste freebsd_committer 2021-07-07 17:33:15 UTC
> Can you please help me with pkg-message?

I have not yet actually tried again with avahi running, but I presume the crash will be gone.

For pkg-message, how about:

Ensure that avahi is running, otherwise some backends may crash.
Comment 7 Ed Maste freebsd_committer 2021-07-07 20:24:09 UTC
/usr/local/lib/sane/libsane-hpaio.so.1 was installed by package hplip-3.20.6

Updated port in summary, I incorrectly submitted against libsane. It should be an upstream bug against hplip and a note in hplip's pkg-message, I think.
Comment 8 Ed Maste freebsd_committer 2021-07-07 20:28:22 UTC
And, I can confirm no more abort() after

# service dbus forcestart
Starting dbus.
# service avahi-daemon forcestart
Starting avahi-daemon.