Paperwork crashes on scanning, I/O Error in Libinsane

Good evening,

after installing Paperwork on a different laptop, also running Arch Linux, it starts well, I can import existing png or jpg files, but I can’t scan. It starts the scan, but the live preview stays a blank page until the whole program crashes.

I startet paperwork from the commandline in order to get the error message. This seems to be the relevant part:

[INFO ] [paperwork_backend.docscan.libinsane] [LibInsane] …/libinsane-1.0.10/subprojects/libinsane/src/bases/sane.c:L520(lis_sane_item_get_scan_parameters): brother4:net1;dev0->sane_get_parameters() returned: format=1, height=2322, width=1648, bytes_per_line=4944, depth=8
[INFO ] [paperwork_backend.docscan.libinsane] [LibInsane] …/libinsane-1.0.10/subprojects/libinsane/src/bases/sane.c:L550(lis_sane_item_get_scan_parameters): Image format: 0
[INFO ] [paperwork_backend.docscan.libinsane] [LibInsane] …/libinsane-1.0.10/subprojects/libinsane/src/bases/sane.c:L551(lis_sane_item_get_scan_parameters): Image WxH: 1648x2322
[INFO ] [paperwork_backend.docscan.libinsane] [LibInsane] …/libinsane-1.0.10/subprojects/libinsane/src/bases/sane.c:L552(lis_sane_item_get_scan_parameters): Image size: 11479968
[INFO ] [paperwork_gtk.mainwindow.docview.scanview] Scan size: 1648x2322
[INFO ] [paperwork_gtk.mainwindow.docview] Going to page 0 (nb pages=1)
[INFO ] [paperwork_gtk.mainwindow.docview] Going to page 0 (nb pages=1)
[INFO ] [paperwork_backend.docscan.libinsane] [LibInsane] ======== PID 65840 - SEGMENTATION FAULT ========
[INFO ] [paperwork_backend.docscan.libinsane] [LibInsane] ======== START OF BACKTRACE ========
[INFO ] [paperwork_backend.docscan.libinsane] [LibInsane] /usr/lib/libinsane.so.1(+0x14b00)[0x7fa59ca40b00]
[INFO ] [paperwork_backend.docscan.libinsane] [LibInsane] /usr/lib/libc.so.6(+0x3e710)[0x7fa5a125c710]
[INFO ] [paperwork_backend.docscan.libinsane] [LibInsane] /usr/lib/sane/libsane-brother4.so.1(make_cache_block+0x3c9)[0x7fa58de25fba]
[INFO ] [paperwork_backend.docscan.libinsane] [LibInsane] /usr/lib/sane/libsane-brother4.so.1(read_scanned_data+0x10b)[0x7fa58de24d62]
[INFO ] [paperwork_backend.docscan.libinsane] [LibInsane] /usr/lib/sane/libsane-brother4.so.1(PageScan+0x5af)[0x7fa58de1408c]
[INFO ] [paperwork_backend.docscan.libinsane] [LibInsane] /usr/lib/sane/libsane-brother4.so.1(sane_brother4_read+0x4b)[0x7fa58de1c6c4]
[INFO ] [paperwork_backend.docscan.libinsane] [LibInsane] /usr/lib/libinsane.so.1(+0x19264)[0x7fa59ca45264]
[INFO ] [paperwork_backend.docscan.libinsane] [LibInsane] /usr/lib/libinsane.so.1(+0x64e2)[0x7fa59ca324e2]
[INFO ] [paperwork_backend.docscan.libinsane] [LibInsane] /usr/lib/libinsane.so.1(+0x176eb)[0x7fa59ca436eb]
[INFO ] [paperwork_backend.docscan.libinsane] [LibInsane] /usr/lib/libinsane.so.1(lis_worker_main+0x1ef)[0x7fa59ca4754f]
[INFO ] [paperwork_backend.docscan.libinsane] [LibInsane] /usr/lib/libinsane.so.1(lis_api_workaround_dedicated_process+0x3be)[0x7fa59ca47ade]
[INFO ] [paperwork_backend.docscan.libinsane] [LibInsane] /usr/lib/libinsane.so.1(lis_safebet+0x1f1)[0x7fa59ca3fbb1]
[INFO ] [paperwork_backend.docscan.libinsane] [LibInsane] /usr/lib/libinsane_gobject.so.1(libinsane_api_new_safebet+0x68)[0x7fa59f5cb7a8]
[INFO ] [paperwork_backend.docscan.libinsane] [LibInsane] /usr/lib/libffi.so.8(+0x74f6)[0x7fa5a11524f6]
[INFO ] [paperwork_backend.docscan.libinsane] [LibInsane] /usr/lib/libffi.so.8(+0x3f5e)[0x7fa5a114ef5e]
[INFO ] [paperwork_backend.docscan.libinsane] [LibInsane] /usr/lib/libffi.so.8(ffi_call+0x123)[0x7fa5a1151b73]
[INFO ] [paperwork_backend.docscan.libinsane] [LibInsane] ======== END OF BACKTRACE ========
read() failed: fd=10, r=0, got=0, expected=8; 0, Erfolg[INFO ] [paperwork_backend.docscan.libinsane] [LibInsane] …/libinsane-1.0.10/subprojects/libinsane/src/workarounds/dedicated_process/protocol.c:L315(lis_protocol_log_read): poll() failed on fd 0-12: 0x10
[ERROR ] [paperwork_backend.docscan.libinsane] [LibInsane] …/libinsane-1.0.10/subprojects/libinsane/src/workarounds/dedicated_process/master.c:L317(remote_call): session_scan_read() failed: 0x40000006, I/O Error
[INFO ] [paperwork_backend.docscan.libinsane] [LibInsane] …/libinsane-1.0.10/subprojects/libinsane/src/workarounds/dedicated_process/protocol.c:L315(lis_protocol_log_read): poll() failed on fd 1-14: 0x10
write() failed: fd=9, w=-1, written=8, expected=0; 32, Datenübergabe unterbrochen (broken pipe)[INFO ] [paperwork_backend.docscan.libinsane] [LibInsane] …/libinsane-1.0.10/subprojects/libinsane/src/workarounds/dedicated_process/master.c:L197(log_thread): Stopping log thread because: 0x40000006, I/O Error
[ERROR ] [paperwork_backend.docscan.libinsane] [LibInsane] …/libinsane-1.0.10/subprojects/libinsane/src/workarounds/dedicated_process/master.c:L306(remote_call): scan_session_cancel() failed: 0x40000006, I/O Error
Speicherzugriffsfehler (Speicherabzug geschrieben)

Details concerning my system:

ti@flipdelle:~$ uname -a
Linux flipdelle 6.6.6-arch1-1 #1 SMP PREEMPT_DYNAMIC Mon, 11 Dec 2023 11:48:23 +0000 x86_64 GNU/Linux
ti@flipdelle:~$ pacman -Q paperwork
paperwork 2.2.1-2

What can I do to solve the problem?

Thanks + best regards,
t_matze

Hello,

Does it work with other applications like simple-scan for instance ?

Best regards,

I can scan any document with xsane and then import it with paperwork. But on my other PC, I didn’t have to do it in two steps with two different programs, I could just launch paperwork and do the scan there.

Here is what I have installed for the scanner:

ti@flipdelle:~$ trizen -Qs sane
local/brscan4 0.4.11_1-2
SANE drivers from Brother for compatible models
local/libinsane 1.0.10-1
Library to access scanners
local/sane 1.2.1-5
Scanner Access Now Easy
local/xsane 0.999-6
A GTK-based X11 frontend for SANE and plugin for Gimp.

Best regards
t_matze

Hello,

Can you try setting the environment variable export LIBINSANE_WORKAROUND_DEDICATED_PROCESS=0, restart Paperwork and retry please ?

Best regards,

Thank you for your suggestion.
I pasted

into the command line and then startet

paperwork-gtk

with the same result - it crashed upon scanning a document. The scanner did something and when I expected the live preview to show the top third of the page, the program disappeared.

Here is the output on the commandline:

PrivateBin: STOUT of paperwork-gtk

Any ideas?

Best regards
t_matze

If you look in ~/.local/share/paperwork2/openpaperwork/logs/, you should have more detailed logs than those you got on stderr. Those logs should include C stacktraces at the end. Can you send me those logs please ? (either by email or here, as you prefer).

Thank you for your answer. I found the logs and sent them to you by mail. But I didn’t find any stacktraces in them (nor do I know what to do with them). Hopefully you find what you need.