Bug 270741 - print/hplip: hp-systray: python3.9 crashes
Summary: print/hplip: hp-systray: python3.9 crashes
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: Tijl Coosemans
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-10 15:00 UTC by Graham Perrin
Modified: 2023-11-17 15:50 UTC (History)
1 user (show)

See Also:
tijl: maintainer-feedback+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Graham Perrin freebsd_committer freebsd_triage 2023-04-10 15:00:59 UTC
% hp-systray

HP Linux Imaging and Printing System (ver. 3.22.10)
System Tray Status Service ver. 2.0

Copyright (c) 2001-18 HP Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

Segmentation fault (core dumped)
% lldb -c ~/python3.9.core -- /usr/local/bin/python3.9
(lldb) target create "/usr/local/bin/python3.9" --core "/home/grahamperrin/python3.9.core"
Core file '/home/grahamperrin/python3.9.core' (x86_64) was loaded.
(lldb) bt
* thread #1, name = 'python3.9', stop reason = signal SIGSEGV
  * frame #0: 0x0000000825416750 libc.so.7`_UTF8_wcsnrtombs(dst=0x0000000000000000, src=<unavailable>, nwc=<unavailable>, len=<unavailable>, ps=<unavailable>) at utf8.c:376:13
    frame #1: 0x000000082546d16c libc.so.7`__wcsconv(wcsarg=unable to read data, prec=<unavailable>) at vfprintf.c:230:12
    frame #2: 0x000000082546b4a6 libc.so.7`__vfprintf(fp=0x00000008203980f8, locale=0x000000082553d618, fmt0="usb://EPSON/Stylus%20SX110?serial=LK3Z152994&interface=1", ap=0x0000000820398230) at vfprintf.c:845:16
    frame #3: 0x00000008254682a7 libc.so.7`snprintf(str="", n=<unavailable>, fmt=<unavailable>) at snprintf.c:74:8
    frame #4: 0x0000000850fff78a libhpipp.so.0`__parsePrinterAttributes + 570
    frame #5: 0x0000000850fff842 libhpipp.so.0`getCupsPrinters + 34
    frame #6: 0x00000008503766c6 cupsext.so`getPrinters + 54
    frame #7: 0x000000082225a996 libpython3.9.so.1.0`___lldb_unnamed_symbol4568 + 134
    frame #8: 0x0000000822217e06 libpython3.9.so.1.0`_PyObject_MakeTpCall + 374
    frame #9: 0x00000008222ef38c libpython3.9.so.1.0`___lldb_unnamed_symbol5464 + 620
    frame #10: 0x00000008222ec0b9 libpython3.9.so.1.0`_PyEval_EvalFrameDefault + 24569
    frame #11: 0x000000082221864a libpython3.9.so.1.0`___lldb_unnamed_symbol3861 + 170
    frame #12: 0x00000008222ef2bb libpython3.9.so.1.0`___lldb_unnamed_symbol5464 + 411
    frame #13: 0x00000008222ec0b9 libpython3.9.so.1.0`_PyEval_EvalFrameDefault + 24569
    frame #14: 0x00000008222f02d2 libpython3.9.so.1.0`___lldb_unnamed_symbol5465 + 3170
    frame #15: 0x00000008222e5fc6 libpython3.9.so.1.0`PyEval_EvalCode + 86
    frame #16: 0x000000082233019f libpython3.9.so.1.0`___lldb_unnamed_symbol5777 + 175
    frame #17: 0x000000082233031e libpython3.9.so.1.0`___lldb_unnamed_symbol5778 + 174
    frame #18: 0x000000082232e5e6 libpython3.9.so.1.0`PyRun_SimpleFileExFlags + 950
    frame #19: 0x000000082234ca13 libpython3.9.so.1.0`Py_RunMain + 2691
    frame #20: 0x000000082234cd5c libpython3.9.so.1.0`___lldb_unnamed_symbol5930 + 364
    frame #21: 0x000000082234cdda libpython3.9.so.1.0`Py_BytesMain + 58
    frame #22: 0x0000000000201730 python3.9`_start + 256
(lldb) q
% pkg iinfo hplip
hplip-3.22.10_1
% uname -aKU
FreeBSD mowa219-gjp4-8570p-freebsd 14.0-CURRENT FreeBSD 14.0-CURRENT #38 main-n262032-5e2e3615d91f: Fri Apr  7 18:54:28 BST 2023     grahamperrin@mowa219-gjp4-8570p-freebsd:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG amd64 1400085 1400085
%
Comment 1 Andrey Volkov 2023-10-24 18:48:28 UTC
The same Segmentation fault here with cups printer attribute:

Gentoo Linux
hplip-3.23.8
python-3.11.6
cups-2.4.7
glibc-2.38

Similar gdb backtrace (no debug symbols)
(gdb) bt
#0  0x00007ffff798d058 in ?? () from /lib64/libc.so.6
#1  0x00007ffff78da35f in wcsrtombs () from /lib64/libc.so.6
#2  0x00007ffff787e554 in ?? () from /lib64/libc.so.6
#3  0x00007ffff7881f38 in ?? () from /lib64/libc.so.6
#4  0x00007ffff78a3190 in ?? () from /lib64/libc.so.6
#5  0x00007ffff793f168 in __snprintf_chk () from /lib64/libc.so.6
#6  0x00007ffff62bc448 in __parsePrinterAttributes () from /usr/lib64/libhpipp.so.0
#7  0x00007ffff62bc503 in getCupsPrinters () from /usr/lib64/libhpipp.so.0
#8  0x00007ffff64df8f0 in getPrinters () from /usr/lib/python3.11/site-packages/cupsext.so
#9  0x00007ffff7b8e751 in ?? () from /usr/lib64/libpython3.11.so.1.0
#10 0x00007ffff7b4c91b in _PyObject_MakeTpCall () from /usr/lib64/libpython3.11.so.1.0
#11 0x00007ffff7b011a8 in _PyEval_EvalFrameDefault () from /usr/lib64/libpython3.11.so.1.0
#12 0x00007ffff7c1db70 in ?? () from /usr/lib64/libpython3.11.so.1.0
#13 0x00007ffff7c1dc2d in PyEval_EvalCode () from /usr/lib64/libpython3.11.so.1.0
#14 0x00007ffff7c5eba3 in ?? () from /usr/lib64/libpython3.11.so.1.0
#15 0x00007ffff7c5edc6 in ?? () from /usr/lib64/libpython3.11.so.1.0
#16 0x00007ffff7c5eea0 in ?? () from /usr/lib64/libpython3.11.so.1.0
#17 0x00007ffff7c617b9 in _PyRun_SimpleFileObject () from /usr/lib64/libpython3.11.so.1.0
#18 0x00007ffff7c61d0c in _PyRun_AnyFileObject () from /usr/lib64/libpython3.11.so.1.0
#19 0x00007ffff7c7efa0 in Py_RunMain () from /usr/lib64/libpython3.11.so.1.0
#20 0x00007ffff7c7f4d7 in Py_BytesMain () from /usr/lib64/libpython3.11.so.1.0
#21 0x00007ffff784bf0a in ?? () from /lib64/libc.so.6
#22 0x00007ffff784bfc5 in __libc_start_main () from /lib64/libc.so.6
#23 0x0000555555555081 in _start ()


DeviceURI usb://EPSON/L132%20Series?serial=564A344B3033323284

The %20 symbols are the cause of the segfault

My workaround was to remove this cups printer. It was unused for a long time in my case.

I wish this helps
Comment 2 commit-hook freebsd_committer freebsd_triage 2023-11-17 15:47:15 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=519a7472d666302ea47f201a45219ef561f1fe09

commit 519a7472d666302ea47f201a45219ef561f1fe09
Author:     Tijl Coosemans <tijl@FreeBSD.org>
AuthorDate: 2023-11-17 14:20:45 +0000
Commit:     Tijl Coosemans <tijl@FreeBSD.org>
CommitDate: 2023-11-17 15:44:22 +0000

    print/hplip: Fix snprintf calls when device URI contains %20

    PR:             270741

 print/hplip/Makefile                             |  1 +
 print/hplip/files/patch-protocol_hp__ipp.c (new) | 46 ++++++++++++++++++++++++
 2 files changed, 47 insertions(+)
Comment 3 Tijl Coosemans freebsd_committer freebsd_triage 2023-11-17 15:50:35 UTC
Can you confirm that the commit above fixes the issue?