#992721 hplip: Scanning with Deskjet 3050A J611 crash

Package:
hplip
Source:
hplip
Description:
HP Linux Printing and Imaging System (HPLIP)
Submitter:
Florence Birée
Date:
2021-11-10 10:00:03 UTC
Severity:
important
#992721#5
Date:
2021-08-22 16:58:26 UTC
From:
To:
Dear Maintainer,

My HP Deskjet 3055A, used only to scan files, doesn't work anymore when
scanning with both hp-scan, xsane or simple-scan, here on Debian
unstable/experimental. It used to work with another computer on Debian
Buster (didn't try with Bullseye, the computer is dead), as well on
other computer with Ubuntu 20.04.

Either of this three programs crashes with this message on a terminal:

I tried to 'apt purge' all packages involved in scanning and hplip, and
install them again, with the same result.

I'm ready to give you more informations if needed…

Thanks for your works,
Florence
--------------- | SYSTEM INFO | --------------- Kernel: 5.10.0-8-amd64 #1 SMP Debian 5.10.46-4 (2021-08-03) GNU/Linux Host: lyra Proc: 5.10.0-8-amd64 #1 SMP Debian 5.10.46-4 (2021-08-03) GNU/Linux Distribution: debian 11 Bitness: 64 bit
----------------------- | HPLIP CONFIGURATION | ----------------------- HPLIP-Version: HPLIP 3.21.4 HPLIP-Home: /usr/share/hplip warning: HPLIP-Installation: Auto installation is not supported for debian distro 11 version Current contents of '/etc/hp/hplip.conf' file: # hplip.conf. Generated from hplip.conf.in by configure. [hplip] version=3.21.4 [dirs] home=/usr/share/hplip run=/var/run ppd=/usr/share/ppd/hplip/HP ppdbase=/usr/share/ppd/hplip doc=/usr/share/doc/hplip html=/usr/share/doc/hplip-doc icon=no cupsbackend=/usr/lib/cups/backend cupsfilter=/usr/lib/cups/filter drv=/usr/share/cups/drv bin=/usr/bin apparmor=/etc/apparmor.d # Following values are determined at configure time and cannot be changed. [configure] network-build=yes libusb01-build=no pp-build=no gui-build=yes scanner-build=yes fax-build=yes dbus-build=yes cups11-build=no doc-build=yes shadow-build=no hpijs-install=yes foomatic-drv-install=yes foomatic-ppd-install=no foomatic-rip-hplip-install=no hpcups-install=yes cups-drv-install=yes cups-ppd-install=no internal-tag=3.21.4 restricted-build=no ui-toolkit=qt5 qt3=no qt4=no qt5=yes policy-kit=yes lite-build=no udev_sysfs_rules=no hpcups-only-build=no hpijs-only-build=no apparmor_build=no class-driver=no Current contents of '/var/lib/hp/hplip.state' file: Plugins are not installed. Could not access file: No such file or directory Current contents of '~/.hplip/hplip.conf' file: [commands] scan = /usr/bin/simple-scan %SANE_URI% [fax] email_address = voice_phone = [installation] date_time = 08/22/21 18:51:05 version = 3.21.4 [last_used] device_uri = hpaio:/usb/Deskjet_3050A_J611_series?serial=CN31L1CQMP05WK printer_name = working_dir = . [polling] device_list = enable = false interval = 5 [refresh] enable = false rate = 30 type = 1 [settings] systray_messages = 0 systray_visible = 0 [upgrade] last_upgraded_time = 1629621696 notify_upgrade = false pending_upgrade_time = 0 <Package-name> <Package-Desc> <Required/Optional> <Min-Version> <Installed-Version> <Status> <Comment>
------------------------- | External Dependencies | ------------------------- error: cups CUPS - Common Unix Printing System REQUIRED 1.1 - INCOMPAT 'CUPS may not be installed or not running' gs GhostScript - PostScript and PDF language interpreter and previewer REQUIRED 7.05 9.53.3 OK - error: xsane xsane - Graphical scanner frontend for SANE OPTIONAL 0.9 - MISSING 'xsane needs to be installed' scanimage scanimage - Shell scanning program OPTIONAL 1.0 1.0.32 OK - dbus DBus - Message bus system REQUIRED - 1.12.20 OK - policykit PolicyKit - Administrative policy framework OPTIONAL - 0.105 OK - network network -wget OPTIONAL - 1.21 OK - avahi-utils avahi-utils OPTIONAL - 0.8 OK -
------------------------ | General Dependencies | ------------------------ error: libjpeg libjpeg - JPEG library REQUIRED - - MISSING 'libjpeg needs to be installed' error: cups-devel CUPS devel- Common Unix Printing System development files REQUIRED - - MISSING 'cups-devel needs to be installed' error: cups-image CUPS image - CUPS image development files REQUIRED - - MISSING 'cups-image needs to be installed' libpthread libpthread - POSIX threads library REQUIRED - b'2.31' OK - error: libusb libusb - USB library REQUIRED - 1.0 MISSING 'libusb needs to be installed' sane SANE - Scanning library REQUIRED - - OK - error: sane-devel SANE - Scanning library development files REQUIRED - - MISSING 'sane-devel needs to be installed' error: libavahi-dev libavahi-dev REQUIRED - - MISSING 'libavahi-dev needs to be installed' error: libnetsnmp-devel libnetsnmp-devel - SNMP networking library development files REQUIRED 5.0.9 - MISSING 'libnetsnmp-devel needs to be installed' libcrypto libcrypto - OpenSSL cryptographic library REQUIRED - 1.1.1 OK - python3X Python 2.2 or greater - Python programming language REQUIRED 2.2 3.9.2 OK - python3-notify2 Python libnotify - Python bindings for the libnotify Desktop notifications OPTIONAL - - OK - error: python3-pyqt4-dbus PyQt 4 DBus - DBus Support for PyQt4 OPTIONAL 4.0 - MISSING 'python3-pyqt4-dbus needs to be installed' error: python3-pyqt4 PyQt 4- Qt interface for Python (for Qt version 4.x) REQUIRED 4.0 - MISSING 'python3-pyqt4 needs to be installed' python3-dbus Python DBus - Python bindings for DBus REQUIRED 0.80.0 1.2.18 OK - python3-xml Python XML libraries REQUIRED - 2.2.10 OK - python3-devel Python devel - Python development files REQUIRED 2.2 3.9.2 OK - python3-pil PIL - Python Imaging Library (required for commandline scanning with hp-scan) OPTIONAL - 8.1.2 OK - python3-reportlab Reportlab - PDF library for Python OPTIONAL 2.0 3.5.59 OK -
-------------- | COMPILEDEP | -------------- error: libtool libtool - Library building support services REQUIRED - - MISSING 'libtool needs to be installed' gcc gcc - GNU Project C and C++ Compiler REQUIRED - 10.2.1 OK - make make - GNU make utility to maintain groups of programs REQUIRED 3.0 4.3 OK -
--------------------- | Python Extentions | --------------------- cupsext CUPS-Extension REQUIRED - 3.21.4 OK - hpmudext IO-Extension REQUIRED - 3.21.4 OK -
---------------------- | Scan Configuration | ---------------------- '/etc/sane.d/dll.d/hpaio' not found. hpaio HPLIP-SANE-Backend REQUIRED - 3.21.4 OK 'hpaio found in /etc/sane.d/dll.conf' scanext Scan-SANE-Extension REQUIRED - 3.21.4 OK -
------------------------------ | DISCOVERED SCANNER DEVICES | ------------------------------ device `hpaio:/usb/Deskjet_3050A_J611_series?serial=CN31L1CQMP05WK' is a Hewlett-Packard Deskjet_3050A_J611_series all-in-one
-------------------------- | DISCOVERED USB DEVICES | -------------------------- Device URI Model -------------------------------------- ---------------------------- hp:/usb/Deskjet_3050A_J611_series?seri HP Deskjet 3050A J611 series al=CN31L1CQMP05WK
--------------------------------- | INSTALLED CUPS PRINTER QUEUES | --------------------------------- Canon_MG3600_EEDF_Vert ---------------------- Type: Unknown Device URI: usb://Canon/MG3600%20series?serial=F90AEA&interface=1 PPD: /etc/cups/ppd/Canon_MG3600_EEDF_Vert.ppd warning: Failed to read /etc/cups/ppd/Canon_MG3600_EEDF_Vert.ppd ppd file PPD Description: Printer status: printer Canon_MG3600_EEDF_Vert is idle. enabled since Sun Feb 16 14:13:12 2020 warning: Printer is not HPLIP installed. Printers must use the hp: or hpfax: CUPS backend for HP-Devices. Canon_Noire_EEDF_Jojo --------------------- Type: Unknown Device URI: usb://Canon/TS5000%20series?serial=573AD6&interface=1 PPD: /etc/cups/ppd/Canon_Noire_EEDF_Jojo.ppd warning: Failed to read /etc/cups/ppd/Canon_Noire_EEDF_Jojo.ppd ppd file PPD Description: Printer status: printer Canon_Noire_EEDF_Jojo is idle. enabled since Sat Jul 3 02:53:48 2021 warning: Printer is not HPLIP installed. Printers must use the hp: or hpfax: CUPS backend for HP-Devices. Canon_Noire_EEDF_Juju --------------------- Type: Unknown Device URI: usb://Canon/TS5000%20series?serial=573BD3&interface=1 PPD: /etc/cups/ppd/Canon_Noire_EEDF_Juju.ppd warning: Failed to read /etc/cups/ppd/Canon_Noire_EEDF_Juju.ppd ppd file PPD Description: Printer status: printer Canon_Noire_EEDF_Juju is idle. enabled since Sun Jun 6 21:01:49 2021 warning: Printer is not HPLIP installed. Printers must use the hp: or hpfax: CUPS backend for HP-Devices. Deskjet_3050A_J611 ------------------ Type: Printer Device URI: hp:/usb/Deskjet_3050A_J611_series?serial=CN31L1CQMP05WK PPD: /etc/cups/ppd/Deskjet_3050A_J611.ppd warning: Failed to read /etc/cups/ppd/Deskjet_3050A_J611.ppd ppd file PPD Description: Printer status: printer Deskjet_3050A_J611 is idle. enabled since Sun Aug 22 18:30:10 2021 Communication status: Good HP_Photosmart_EEDF_Noire ------------------------ Type: Printer Device URI: hp:/usb/Photosmart_B010_series?serial=CN08Q2K1YR05K9 PPD: /etc/cups/ppd/HP_Photosmart_EEDF_Noire.ppd warning: Failed to read /etc/cups/ppd/HP_Photosmart_EEDF_Noire.ppd ppd file PPD Description: Printer status: printer HP_Photosmart_EEDF_Noire disabled since Thu Feb 20 19:23:27 2020 - Backend /usr/lib/cups/backend/hp does not exist! error: Unable to communicate with device (code=12): hp:/usb/Photosmart_B010_series?serial=CN08Q2K1YR05K9 error: Device not found error: Communication status: Failed Imprimante_Parents_HP_C5180 --------------------------- Type: Unknown Device URI: dnssd://Photosmart%20C5100%20series%20%5BB843EE%5D._pdl-datastream._tcp.local/ PPD: /etc/cups/ppd/Imprimante_Parents_HP_C5180.ppd warning: Failed to read /etc/cups/ppd/Imprimante_Parents_HP_C5180.ppd ppd file PPD Description: Printer status: printer Imprimante_Parents_HP_C5180 is idle. enabled since Fri Dec 20 23:44:55 2019 warning: Printer is not HPLIP installed. Printers must use the hp: or hpfax: CUPS backend for HP-Devices. Lexmark-An01 ------------ Type: Unknown Device URI: socket://192.168.15.244:9100 PPD: /etc/cups/ppd/Lexmark-An01.ppd warning: Failed to read /etc/cups/ppd/Lexmark-An01.ppd ppd file PPD Description: Printer status: printer Lexmark-An01 is idle. enabled since Fri Aug 13 11:11:49 2021 warning: Printer is not HPLIP installed. Printers must use the hp: or hpfax: CUPS backend for HP-Devices. MG3600-series-EEDF-Grise ------------------------ Type: Unknown Device URI: usb://Canon/MG3600%20series?serial=96F692&interface=1 MP280-series ------------ Type: Unknown Device URI: usb://Canon/MP280%20series?serial=193EED&interface=1 PPD: /etc/cups/ppd/MP280-series.ppd warning: Failed to read /etc/cups/ppd/MP280-series.ppd ppd file PPD Description: Printer status: printer MP280-series disabled since Tue Mar 9 11:59:49 2021 - Unplugged or turned off warning: Printer is not HPLIP installed. Printers must use the hp: or hpfax: CUPS backend for HP-Devices. Samsung_C48x_Utopons -------------------- Type: Unknown Device URI: usb://Samsung/C48x%20Series?serial=0BEKB8KHBB0141V&interface=1 PPD: /etc/cups/ppd/Samsung_C48x_Utopons.ppd warning: Failed to read /etc/cups/ppd/Samsung_C48x_Utopons.ppd ppd file PPD Description: Printer status: printer Samsung_C48x_Utopons disabled since Sun Jun 20 15:50:12 2021 - Unplugged or turned off warning: Printer is not HPLIP installed. Printers must use the hp: or hpfax: CUPS backend for HP-Devices. Toshiba_Perm ------------ Type: Unknown Device URI: dnssd://TOSHIBA%20e-STUDIO2500AC-12032774._ipp._tcp.local/?uuid=12bcbc24-2634-46bc-b4fd-6e564b29ddfd PPD: /etc/cups/ppd/Toshiba_Perm.ppd warning: Failed to read /etc/cups/ppd/Toshiba_Perm.ppd ppd file PPD Description: Printer status: printer Toshiba_Perm is idle. enabled since Fri Jun 25 14:31:45 2021 warning: Printer is not HPLIP installed. Printers must use the hp: or hpfax: CUPS backend for HP-Devices. XEROX_3100MFP_Diego ------------------- Type: Unknown Device URI: usb://XEROX/Phaser%203100MFP?serial=L510251LE890328 PPD: /etc/cups/ppd/XEROX_3100MFP_Diego.ppd warning: Failed to read /etc/cups/ppd/XEROX_3100MFP_Diego.ppd ppd file PPD Description: Printer status: printer XEROX_3100MFP_Diego disabled since Sat Aug 21 19:05:49 2021 - Unplugged or turned off warning: Printer is not HPLIP installed. Printers must use the hp: or hpfax: CUPS backend for HP-Devices.
-------------- | PERMISSION | -------------- USB Deskjet_3050A_J611 Required - - OK Node:'/dev/bus/usb/002/010' Perm:' root lp rw- rw- rw- rw- rw- r--'
----------- | SUMMARY | ----------- Missing Required Dependencies ----------------------------- error: 'cups' package is missing or 'cups' service is not running. error: 'libcups2' package is missing/incompatible error: 'libjpeg62-turbo-dev' package is missing/incompatible error: 'libcups2-dev' package is missing/incompatible error: 'cups-bsd' package is missing/incompatible error: 'cups-client' package is missing/incompatible error: 'libcupsimage2' package is missing/incompatible error: 'libcupsimage2-dev' package is missing/incompatible error: 'libusb-1.0.0-dev' package is missing/incompatible error: 'libsane-dev' package is missing/incompatible error: 'libavahi-client-dev' package is missing/incompatible error: 'libavahi-core-dev' package is missing/incompatible error: 'libavahi-common-dev' package is missing/incompatible error: 'libsnmp-dev' package is missing/incompatible error: 'snmp' package is missing/incompatible error: 'python3-pyqt4' package is missing/incompatible error: 'gtk2-engines-pixbuf' package is missing/incompatible error: 'libtool' package is missing/incompatible error: 'libtool-bin' package is missing/incompatible Missing Optional Dependencies ----------------------------- error: 'xsane' package is missing/incompatible error: 'python3-dbus.mainloop.qt' package is missing/incompatible Total Errors: 13 Total Warnings: 9 Done.
#992721#10
Date:
2021-08-23 14:03:58 UTC
From:
To:
Hello Florence,

Thank you for your detailed report. Please give us the output of

  grep PRETTY /usr/lib/os-release

Regards,

Brian.

#992721#15
Date:
2021-08-23 15:35:11 UTC
From:
To:
Hello Brian,

Here is the output:

$ grep PRETTY /usr/lib/os-release
PRETTY_NAME="Debian GNU/Linux bookworm/sid"

Regards,
Florence

Le Mon, 23 Aug 2021 15:03:58 +0100,
Brian Potkin <claremont102@gmail.com> a écrit :

#992721#20
Date:
2021-08-23 16:05:28 UTC
From:
To:
Reduce bookworm/sid to fewer than 12 characters. For examole, remove
"sid". Save and try scanning.

Cheers,

Brian.

#992721#25
Date:
2021-08-23 19:04:09 UTC
From:
To:
Le Mon, 23 Aug 2021 17:05:28 +0100,
Brian Potkin <claremont102@gmail.com> a écrit :

This makes hp-scan works well, thanks! (I've now a working scanning
solution)

But the problem is still the same for simple-scan and xsane…

Cheers,

#992721#30
Date:
2021-08-23 22:50:45 UTC
From:
To:
That's something, at least.

Is the "stack smashing detected" message given in these cases?

Please provide

  scanimage -L

Cheers,

Brian.

#992721#35
Date:
2021-08-24 09:18:15 UTC
From:
To:
Le Mon, 23 Aug 2021 23:50:45 +0100,
Brian Potkin <claremont102@gmail.com> a écrit :

Yes, exactly.

$ scanimage -L
device `hpaio:/usb/Deskjet_3050A_J611_series?serial=CN31L1CQMP05WK' is
a Hewlett-Packard Deskjet_3050A_J611_series all-in-one

Cheers,

#992721#40
Date:
2021-08-24 09:50:19 UTC
From:
To:
Can you scan with any of these?

scanimage -d "hpaio:/usb/Deskjet_3050A_J611_series?serial=CN31L1CQMP05WK" > image.pnm
simple-scan "hpaio:/usb/Deskjet_3050A_J611_series?serial=CN31L1CQMP05WK"
xsane "hpaio:/usb/Deskjet_3050A_J611_series?serial=CN31L1CQMP05WK"

You could also try removing the slash from os-release.

Cheers,

Brian.

#992721#45
Date:
2021-08-24 10:34:19 UTC
From:
To:
Le Tue, 24 Aug 2021 10:50:19 +0100,
Brian Potkin <claremont102@gmail.com> a écrit :

With some tests, it seems the crash is not always reproducible (sometimes, it's working…),
so I run each command 4 times to see (and add hp-scan again, in case it crash sometimes too).

Without removing the slash:

$ scanimage -d "hpaio:/usb/Deskjet_3050A_J611_series?serial=CN31L1CQMP05WK" > image.pnm

-> on 4 runs, 1 give "stack smashing", 3 works well…

$ simple-scan "hpaio:/usb/Deskjet_3050A_J611_series?serial=CN31L1CQMP05WK"

-> on 4 runs, 4 "stack smashing" crashes. I can see the top of the image appearing in simple-scan,
and the program do no crash at the same times (sometimes more of the scan is displayed before the
crash)

$ xsane "hpaio:/usb/Deskjet_3050A_J611_series?serial=CN31L1CQMP05WK"

-> on 4 runs, 4 "stack smashing" crashes

$ hp-scan

-> on 4 runs, 4 "stack smashing" crash… (but it worked yesterday…)

** after the removal of the slash in os-release:

$ scanimage -d "hpaio:/usb/Deskjet_3050A_J611_series?serial=CN31L1CQMP05WK" > image.pnm

-> on 4 runs, 1 "stack smashing", 3 works

$ simple-scan "hpaio:/usb/Deskjet_3050A_J611_series?serial=CN31L1CQMP05WK"

-> on 4 runs, 4 "stack smashing" crashes.

$ xsane "hpaio:/usb/Deskjet_3050A_J611_series?serial=CN31L1CQMP05WK"

-> on 4 runs, 4 "stack smashing" crashes (but on some preliminary tests, it works sometimes…)

$ hp-scan

-> on 4 runs, 4 "stack smashing" crash, at various percentages of scanning


So… it seems the problem is not 100% reproducible, even if it happens in the large majority
of times… And I'm not sure the os-release changes really changes something, maybe the times when
hp-scan was working was just luck…

Cheers,

#992721#50
Date:
2021-08-24 12:27:03 UTC
From:
To:
That's a lot of work you have done, Florence! Thanks.

We have met this "stack smashing" situation before but in a printing
context. OdyX managed to fix it then. Bug #932246.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=932246

There is very little more I can do now, apart from suggesting a downgrade
from HPLIP experimental packages to unstable ones. scanimage appears to
be your best bet for scanning for the present.

Good Luck,

Brian.

#992721#55
Date:
2021-09-13 16:11:40 UTC
From:
To:
Hello Florence,
there might be still something that could be done
to retrieve some more information (if you have still
the versions installed that show the issue).

The easiest first thing might be to install the package
systemd-coredump, if possible.

Then open in another terminal 'journalctl -f'.

And reproduce one of the "stack smashings".

Then in the other terminal a "Stack trace" should appear - this
should point out the library and maybe function where the issue is.

Kind regards,
Bernhard

#992721#60
Date:
2021-09-15 17:00:36 UTC
From:
To:
Hi Bernhard,

Here is the stack trace (scanning with simple-scan):

sept. 15 18:55:47 lyra systemd[1]: Created slice Slice /system/systemd-coredump.
sept. 15 18:55:47 lyra systemd[1]: Started Process Core Dump (PID 113128/UID 0).
sept. 15 18:55:48 lyra systemd-coredump[113129]: [🡕] Process 113052 (simple-scan) of user 1000 dumped core.

                                                 Stack trace of thread 113079:
                                                 #0  0x00007f858b12ae71 raise (libc.so.6 + 0x3ce71)
                                                 #1  0x00007f858b114536 abort (libc.so.6 + 0x26536)
                                                 #2  0x00007f858b16c2b8 n/a (libc.so.6 + 0x7e2b8)
                                                 #3  0x00007f858b1fad42 __fortify_fail (libc.so.6 + 0x10cd42)
                                                 #4  0x00007f858b1fad20 __stack_chk_fail (libc.so.6 + 0x10cd20)
                                                 #5  0x00007f857c763146 get_size (libsane-hpaio.so.1 + 0x14146)
                                                 #6  0xffffffffffffffff n/a (n/a + 0x0)
sept. 15 18:55:48 lyra systemd[1]: systemd-coredump@0-113128-0.service:
Succeeded.

I hope it will be useful!

Cheers,
Florence

Le Mon, 13 Sep 2021 18:11:40 +0200,
Bernhard Übelacker <bernhardu@mailbox.org> a écrit :

#992721#65
Date:
2021-09-15 22:29:47 UTC
From:
To:
Hello Florence, dear Maintainer,


Thanks for the fast response.
 From looking at this stack trace I assume a stack variable in
function "get_size" gets overwritten. At the end of this function
the stack check gets triggered.

 From looking at [1] I _think_ the issue might be with the
variable "char buffer[7]".
It looks like this buffer gets some hexadecimal size
information written to from a http connection.

Therefore my hypothesis is that either this "size" exceeds what
is with these 7 places possible (would be 268 MB ?),
or some unexpected input is read from the connection and
therefore the loop is not left before the buffer is overrun.

One easy thing might be to test if the resolution could be
changed to some lower value in the hope to get this "size" to
a lower value, does the scan then succeed ?

Kind regards,
Bernhard



[1] https://sources.debian.org/src/hplip/3.21.6+dfsg0-1/scan/sane/bb_ledm.c/#L1086
     1084
     1085    int get_size(struct ledm_session* ps)
     1086    {
     1087      struct bb_ledm_session *pbb = ps->bb_session;
     1088      char buffer[7];
     1089      int i=0, tmo=50, len;
     1090
     1091      if(ps->currentResolution >= 1200) tmo *= 5;
     1092
     1093      while(1)
     1094      {
     1095        if(http_read_size(pbb->http_handle, buffer+i, 1, tmo, &len) == 2) return 0;
     1096        if( i && *(buffer+i) == '\n' && *(buffer+i-1) == '\r') break;
     1097        i++;
     1098      }
     1099      *(buffer+i+1)='\0';
     1100      return strtol(buffer, NULL, 16);
     1101    }
     1102

[2] https://sources.debian.org/src/hplip/3.21.6+dfsg0-1/scan/sane/http.c/#L513

#992721#70
Date:
2021-09-16 08:28:30 UTC
From:
To:
Am 16.09.21 um 00:29 schrieb Bernhard Übelacker:
6 bytes for the hex number and 1 byte termination.
Would just give something around 16 MB as a maximum?

Kind regards,
Bernhard

#992721#75
Date:
2021-09-20 08:38:03 UTC
From:
To:
Hello,

Le Thu, 16 Sep 2021 00:29:47 +0200,
Bernhard Übelacker <bernhardu@mailbox.org> a écrit :

You seems to be right. I try to scan with simple scan, in text mode:

 - with resolution 75ppp: scan ok
 - with resolution 150ppp: scan ok
 - with resolution 200ppp: scan ok
 - with resolution 300ppp: simple scan crash, stack smashing detected

the stack trace:
sept. 20 10:31:48 lyra systemd-coredump[78476]: [🡕] Process 78221
(simple-scan) of user 1000 dumped core.
Stack trace of thread 78257:
#0  0x00007f7ebfeeee71 raise (libc.so.6 + 0x3ce71)
#1  0x00007f7ebfed8536 abort (libc.so.6 + 0x26536)
#2  0x00007f7ebff302b8 n/a (libc.so.6 + 0x7e2b8)
#3  0x00007f7ebffbed42 __fortify_fail (libc.so.6 + 0x10cd42)
#4  0x00007f7ebffbed20 __stack_chk_fail (libc.so.6 + 0x10cd20)
#5  0x00007f7e9834b146 get_size (libsane-hpaio.so.1 + 0x14146)
#6  0xffffffffffffffff n/a (n/a + 0x0)

Cheers,

#992721#80
Date:
2021-09-20 17:18:11 UTC
From:
To:
Hello Florence, dear Maintainer,
then attached patch is growing this buffer from 6
to 10 usable bytes, making a size around 1 TB possible.
And tries to break the loop before overrunning the buffer.

Unfortunately I cannot test this patch,
so it is completely untested, just compiles...

Kind regards,
Bernhard

#992721#85
Date:
2021-09-21 16:36:58 UTC
From:
To:
Hi,

I applied the patch and try it on hplip 3.21.6+dfsg0-1.

No more stack smashing. But at a random point during the scan,
simple-scan stop and display a message : « Failed to scan - Error
communicating with scanner ».
Nothing in the terminal nor in journald.

The random point where it failed is random in the sense of when I scan,
I can show the beginning of the scanned picture appear in simple-scan,
and at one point (sometimes at the begining, sometimes near the end),
the error message appear.

Cheers,
Florence

Le Mon, 20 Sep 2021 19:18:11 +0200,
Bernhard Übelacker <bernhardu@mailbox.org> a écrit :

#992721#90
Date:
2021-09-26 11:00:26 UTC
From:
To:
Am 21.09.21 um 18:36 schrieb Florence Birée:


Hello Florence,
so the patch helps for the stack smashing, but the
error message might have other reasons.

The message itself is located in one of these lines [1] in simple-scan.

You could try to run simple-scan with some environment variables,
to active some more verbose debugging output.
I think these in [2] coult already be quite verbose.


[1]
https://sources.debian.org/src/simple-scan/40.5-1/src/scanner.vala/#L1368
https://sources.debian.org/src/simple-scan/40.5-1/src/scanner.vala/#L1479

[2]
   script -c "SANE_DEBUG_DLL=255 SANE_DEBUG_ESCL=255 SANE_DEBUG_SANEI_TCP=255 simple-scan" -a ~/simple-scan-debug-output.txt

#992721#95
Date:
2021-09-30 15:01:03 UTC
From:
To:
Hello Bernhard,

I join the log of simple-scan using the variable you sent.

To get it, on the fist run of simple-scan, everything went ok. I run
simple-scan again, and the error message appear (still this randomness
in the problem…)

I joined only the log of the failed run, but I can also send the log of
the successful run, if it can help…

Best regards,
Florence

Le Sun, 26 Sep 2021 13:00:26 +0200,
Bernhard Übelacker <bernhardu@mailbox.org> a écrit :

#992721#100
Date:
2021-11-10 09:49:17 UTC
From:
To:
Maybe this is helpful(?)

I had the same troubles after upgrade to bullseye (scanning and
printing) using an HP officejet 4630.

After sveral purge and reinstall of hplip I finally moved to
sane-airscan and the bug is still unsolved. i

hplip is not installed anymore, so maybe it is not hplip related?

This is what I do (using sane-airscan):

Switching on officejet, /var/log/messages recognizes the new usb device
and things look ok.

Starting simple scan, two devices are detected: Selecting the eSCL entry
(the other entry does not work, but that is another topic).

Starting scan gives an error message in a pop-up:
"Scanning failed - scan process could not be started"
(my translation of the original German message)

But the scanner is actually starting to scan without giving a result.
/var/log/messages gives:
The weird thing now is that without changing anything, just restarting
simple-scan scanning works perfectly.
Next scan fails again....
In approx. 90% of the scans it fails, in 10% it is ok without changing
anything in the setting.

Scanimage the same effect:

scanimage  -v --format=jpeg -o out.jpg
scanimage: sane_start: Error during device I/O

A few seconds later without changing anything:
scanimage  -v --format=jpeg -o out.jpg
scanimage: scanning image of size 2550x3508 pixels at 24 bits/pixel
scanimage: acquiring RGB frame
scanimage: min/max graylevel value = 2/255
scanimage: read 26836200 bytes in total

Let me know if I can provide better log outputs.

Ulrich