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: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Tijl Coosemans
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-07 00:02 UTC by Ed Maste
Modified: 2022-03-14 10:48 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Maste freebsd_committer freebsd_triage 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 freebsd_triage 2021-07-07 00:05:43 UTC
Observed with sane-backends-1.0.32_4 on (approximately) FreeBSD 13.0
Comment 3 Vladimir Druzenko freebsd_committer freebsd_triage 2021-07-07 10:13:14 UTC
Do you ask to make AVAHI OFF by default?
Comment 4 Ed Maste freebsd_committer freebsd_triage 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 Vladimir Druzenko freebsd_committer freebsd_triage 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 freebsd_triage 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 freebsd_triage 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 freebsd_triage 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.
Comment 9 commit-hook freebsd_committer freebsd_triage 2022-03-11 14:52:49 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=982e968ef61a94e0de75d733e9036e5c60afca34

commit 982e968ef61a94e0de75d733e9036e5c60afca34
Author:     Tijl Coosemans <tijl@FreeBSD.org>
AuthorDate: 2021-08-25 13:29:51 +0000
Commit:     Tijl Coosemans <tijl@FreeBSD.org>
CommitDate: 2022-03-11 14:49:48 +0000

    print/hplip(-plugin): update to 3.22.2

    - Convert post-patch to real patches because they are easier to
      maintain.
    - Fix a NULL dereference in the scanner backend when D-Bus isn't
      running.
    - Depend on sysutils/py-distro to make hp-toolbox (Device Manager) work
      again.
    - Upstream switched to Avahi for mDNS support.  Rename the SNMP option
      to NETWORK because it's not just SNMP now.
    - Don't install some programs related to uninstalling and upgrading of
      HPLIP and the installation of firmware plugins because they circumvent
      the package system.
    - Install icons in share/icons so desktops can choose an appropriate
      resolution.

    Portions taken from a patch by Oleg Sidorkin <osidorkin@gmail.com>.

    PR:             255586, 257034, 257512

 print/hplip-plugin/Makefile                        |   2 +-
 print/hplip-plugin/distinfo                        |   6 +-
 print/hplip/Makefile                               | 110 ++++++++---------
 print/hplip/distinfo                               |   6 +-
 print/hplip/files/patch-FindPPD.cpp (new)          |  11 ++
 print/hplip/files/patch-Makefile.in                | 137 +++++++++++----------
 print/hplip/files/patch-base_g.py (new)            |  29 +++++
 print/hplip/files/patch-base_os__utils.py (new)    |  11 ++
 print/hplip/files/patch-base_queues.py (new)       |  11 ++
 print/hplip/files/patch-base_utils.py (new)        |  17 +++
 print/hplip/files/patch-base_validation.py (new)   |  11 ++
 print/hplip/files/patch-check.py (new)             |  35 ++++++
 print/hplip/files/patch-common_utils.c (new)       |  11 ++
 print/hplip/files/patch-configure (new)            |  70 +++++++++++
 print/hplip/files/patch-doc_index.html (new)       |  11 ++
 .../files/patch-doc_troubleshooting.html (new)     |  46 +++++++
 print/hplip/files/patch-fax_backend_hpfax.py (new) |  29 +++++
 print/hplip/files/patch-fax_filters_pstotiff (new) |  15 +++
 print/hplip/files/patch-hp-uiscan.desktop.in (new) |  14 +++
 print/hplip/files/patch-hpdio.py (new)             |  11 ++
 .../files/patch-hplip-systray.desktop.in (new)     |  13 ++
 print/hplip/files/patch-hplip.desktop.in (new)     |  13 ++
 .../files/patch-installer_core__install.py (new)   |  11 ++
 print/hplip/files/patch-installer_dcheck.py        |   4 +-
 .../files/patch-installer_pluginhandler.py (new)   |  56 +++++++++
 print/hplip/files/patch-io_hpmud_musb.c            |   6 +-
 print/hplip/files/patch-logcapture.py (new)        |  31 +++++
 print/hplip/files/patch-prnt_backend_hp.c (new)    |  11 ++
 print/hplip/files/patch-prnt_cups.py (new)         |  88 +++++++++++++
 print/hplip/files/patch-prnt_filters_hpps (new)    |  20 +++
 .../files/patch-prnt_hpcups_CommonDefinitions.h    |   2 +-
 .../hplip/files/patch-prnt_hpcups_ErnieFilter.cpp  |   2 +-
 .../hplip/files/patch-prnt_hpcups_HPCupsFilter.cpp |  74 +++--------
 .../patch-prnt_hpcups_SystemServices.cpp (new)     |  11 ++
 .../files/patch-prnt_hpcups_genJPEGStrips.cpp      |   2 +-
 .../files/patch-prnt_hpijs_hpcupsfax.cpp (new)     |  20 +++
 print/hplip/files/patch-prnt_hpps_hppsfilter.c     |  13 +-
 .../files/patch-protocol_discovery_mdns.c (gone)   |  86 -------------
 .../patch-scan_sane_OrbliteScan_BSDCommon.h (gone) |  63 ----------
 ...patch-scan_sane_OrbliteScan_LinuxCommon.h (new) |  13 ++
 .../files/patch-scan_sane_OrbliteScan_MacCommon.h  |  19 ++-
 print/hplip/files/patch-scan_sane_hpaio.c          |  24 ++--
 print/hplip/files/patch-scan_sane_io.c (new)       |  14 +++
 print/hplip/files/patch-scan_sane_orblite.c        |   2 +-
 print/hplip/files/patch-ui5_devmgr5.py (new)       |  11 ++
 print/hplip/files/patch-ui5_scandialog.py (new)    |  23 ++++
 print/hplip/pkg-descr                              |  11 +-
 print/hplip/pkg-plist                              |  74 ++++++++---
 48 files changed, 910 insertions(+), 400 deletions(-)