Bug 445139 - Skanpage coredump
Summary: Skanpage coredump
Status: RESOLVED FIXED
Alias: None
Product: libksane
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR crash
Target Milestone: ---
Assignee: Kåre Särs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-07 22:20 UTC by idimitro
Modified: 2022-01-10 07:37 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
logs (17.20 KB, application/gzip)
2021-11-07 22:20 UTC, idimitro
Details
backtrace from previous run (45.50 KB, text/plain)
2021-11-09 00:00 UTC, idimitro
Details
debug_traces (16.76 KB, text/vnd.kde.kcrash-report)
2021-11-09 23:55 UTC, idimitro
Details
backtrace+libsane.dbg (17.34 KB, text/vnd.kde.kcrash-report)
2021-11-10 10:06 UTC, idimitro
Details
gdb generated backtrace (29.95 KB, text/plain)
2021-11-10 10:53 UTC, idimitro
Details

Note You need to log in before you can comment on or make changes to this bug.
Description idimitro 2021-11-07 22:20:33 UTC
Created attachment 143324 [details]
logs

SUMMARY
When I start skanpage from Plasma or from the CLI it generates coredump and exits. 

STEPS TO REPRODUCE
1. Start skanpage via GUI or CLI
2. 
3. 

OBSERVED RESULT
Skanpage window closes. In some cases the window doesn't close, the scanner is found and scanning is initiated but only empty pages are produced. 
Scanning with Skanlite works as expected. 

EXPECTED RESULT
Skanpage shows the scanned content. 

SOFTWARE/OS VERSIONS

Operating System: Arch Linux
KDE Plasma Version: 5.23.2
KDE Frameworks Version: 5.87.0
Qt Version: 5.15.2
Kernel Version: 5.14.16-arch1-1 (64-bit)
Graphics Platform: X11
Processors: 16 × AMD Ryzen 7 3800X 8-Core Processor
Memory: 62.7 GiB of RAM
Graphics Processor: Radeon RX550/550 Series

ADDITIONAL INFORMATION
In the attachment are the logs from application execution. The important line is 51/52 "Re-raising signal for core dump handling.
[2]  + 406506 segmentation fault (core dumped)  skanpage"
The scanner details are available in the scanimage.log
The core dump can be downloaded from here: https://drive.google.com/file/d/1SrcdAPSNvNthNGCg5Xifgp8nBHuLt1tQ/view?usp=sharing 

Please let me know if any further information is needed for debugging.
Comment 1 Nate Graham 2021-11-08 23:37:45 UTC
We don't need the whole dump, just a backtrace. Can you get one of those? Thanks!
Comment 2 idimitro 2021-11-09 00:00:35 UTC
Created attachment 143355 [details]
backtrace from previous run
Comment 3 idimitro 2021-11-09 00:01:37 UTC
Hello, teh backtrace from previous run in the attachment.
Comment 4 Nate Graham 2021-11-09 03:35:57 UTC
Thanks. Pasting inline:

#0  0x00007fa9702d1d22 raise (libc.so.6 + 0x3cd22)
#1  0x00007fa9724e23e0 _ZN6KCrash19defaultCrashHandlerEi (libKF5Crash.so.5 + 0x53e0)
#2  0x00007fa9702d1da0 __restore_rt (libc.so.6 + 0x3cda0)
#3  0x00007fa9703f5515 __strlen_avx2 (libc.so.6 + 0x160515)
#4  0x00007fa9683ca1eb n/a (libsane-net.so.1 + 0x91eb)
#5  0x00007fa9683cbbed sane_net_control_option (libsane-net.so.1 + 0xabed)
#6  0x00007fa972589d10 n/a (libKF5Sane.so.5 + 0x4bd10)
#7  0x00007fa972581c52 n/a (libKF5Sane.so.5 + 0x43c52)
#8  0x00007fa9709697ab n/a (libQt5Core.so.5 + 0x2f07ab)

So the crash is somewhere in libksane, but we need debug symbols for that package to be able to see where. Can you install them and generate a new backtrace?
Comment 5 idimitro 2021-11-09 23:55:26 UTC
Created attachment 143389 [details]
debug_traces

Hi, here is the backtrace with debug symbols. I reproduced the issue on Neon machine on the same network with the same printer.
Comment 6 Kåre Särs 2021-11-10 06:13:37 UTC
Thanks for the trace...

Strange that Skanlite works, but Skanpage crashes.... The backtrace shows that the actual crash is in the net backend in sane...

The reason why it crashes is still a bit unclear... Could you install also the debug symbols for libsane (libsane-dbg)
Comment 7 idimitro 2021-11-10 10:06:52 UTC
Created attachment 143401 [details]
backtrace+libsane.dbg

Here is the backtrace with libsane debug symbols. I hope it is enough because DRKonqi's backtrace generation stoped working :)
Comment 8 idimitro 2021-11-10 10:53:39 UTC
Created attachment 143403 [details]
gdb generated backtrace

One more backtrace generated with gdb. For sure I can confirm that skanlite and xsane are working with no issue with the same scanner.
Comment 9 Bug Janitor Service 2021-11-25 04:38:58 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 10 Bug Janitor Service 2021-12-19 16:37:23 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/libksane/-/merge_requests/57
Comment 11 Bug Janitor Service 2021-12-19 16:43:18 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/skanpage/-/merge_requests/20
Comment 12 Alexander Stippich 2021-12-20 19:28:25 UTC
Git commit 7b56da61d29dd926ebad38ade5790542be30a1c6 by Alexander Stippich.
Committed on 19/12/2021 at 16:35.
Pushed by astippich into branch 'master'.

do not start FindDevicesThread unconditionally

and document SANE API limitations

M  +0    -3    src/ksanecore.cpp
M  +12   -7    src/ksanecore.h
M  +0    -2    src/ksanecore_p.cpp
M  +0    -1    src/ksanewidget.cpp
M  +1    -2    src/ksanewidget.h

https://invent.kde.org/graphics/libksane/commit/7b56da61d29dd926ebad38ade5790542be30a1c6
Comment 13 Alexander Stippich 2021-12-20 19:34:13 UTC
Git commit f2dc2314e7ee92fa22f3553b14aae032c8f89439 by Alexander Stippich.
Committed on 20/12/2021 at 19:29.
Pushed by astippich into branch 'master'.

workaround SANE limitations

M  +26   -8    src/Skanpage.cpp
M  +5    -2    src/Skanpage.h

https://invent.kde.org/utilities/skanpage/commit/f2dc2314e7ee92fa22f3553b14aae032c8f89439
Comment 14 Alexander Stippich 2021-12-20 19:39:53 UTC
Git commit 505e285a5d502251d2f13751a5e2b0455b5708e5 by Alexander Stippich.
Committed on 20/12/2021 at 19:39.
Pushed by astippich into branch 'release/21.12'.

do not start FindDevicesThread unconditionally

and document SANE API limitations


(cherry picked from commit 7b56da61d29dd926ebad38ade5790542be30a1c6)

M  +0    -3    src/ksanecore.cpp
M  +12   -7    src/ksanecore.h
M  +0    -2    src/ksanecore_p.cpp
M  +0    -1    src/ksanewidget.cpp
M  +1    -2    src/ksanewidget.h

https://invent.kde.org/graphics/libksane/commit/505e285a5d502251d2f13751a5e2b0455b5708e5
Comment 15 Alexander Stippich 2021-12-30 09:53:29 UTC
This should be fixed in master now. If not, please reopen
Comment 16 idimitro 2022-01-10 07:37:40 UTC
Thanks for the fix. With skanpage-git and ksanelib-git works ok.