Bug 303867 - skanlite (libksane) crashing when saving image
Summary: skanlite (libksane) crashing when saving image
Status: RESOLVED WORKSFORME
Alias: None
Product: libksane
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Ubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: Kåre Särs
URL:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2012-07-20 20:45 UTC by tmp
Modified: 2018-10-27 04:14 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tmp 2012-07-20 20:45:38 UTC
Application: skanlite (0.7)
KDE Platform Version: 4.8.4 (4.8.4)
Qt Version: 4.8.1
Operating System: Linux 3.2.0-26-generic x86_64
Distribution: Ubuntu 12.04 LTS

-- Information about the crash:
- What I was doing when the application crashed: A picture was scanned and the save-dialog was opened. When I clicked OK, the app crashed.

The crash can be reproduced every time.

-- Backtrace:
Application: Skanlite (skanlite), signal: Segmentation fault
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Current thread is 1 (Thread 0x7fcc4e68d780 (LWP 17526))]

Thread 4 (Thread 0x7fcc3d30b700 (LWP 17527)):
#0  0x00007fcc48739043 in __pthread_mutex_unlock_usercnt (mutex=<optimized out>, decr=<optimized out>) at pthread_mutex_unlock.c:38
#1  __pthread_mutex_unlock (mutex=0x7fcc38000a60) at pthread_mutex_unlock.c:290
#2  0x00007fcc482a45d1 in g_mutex_unlock () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007fcc4826902a in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007fcc48269164 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007fcc4c043426 in QEventDispatcherGlib::processEvents (this=0x7fcc380008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:426
#6  0x00007fcc4c012c82 in QEventLoop::processEvents (this=<optimized out>, flags=...) at kernel/qeventloop.cpp:149
#7  0x00007fcc4c012ed7 in QEventLoop::exec (this=0x7fcc3d30add0, flags=...) at kernel/qeventloop.cpp:204
#8  0x00007fcc4bf11fa7 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:501
#9  0x00007fcc4bff29ff in QInotifyFileSystemWatcherEngine::run (this=0x1cc29b0) at io/qfilesystemwatcher_inotify.cpp:248
#10 0x00007fcc4bf14fcb in QThreadPrivate::start (arg=0x1cc29b0) at thread/qthread_unix.cpp:298
#11 0x00007fcc48735e9a in start_thread (arg=0x7fcc3d30b700) at pthread_create.c:308
#12 0x00007fcc4b8ce4bd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#13 0x0000000000000000 in ?? ()

Thread 3 (Thread 0x7fcc2955b700 (LWP 17972)):
#0  0x00007fcc4b8c2b03 in __GI___poll (fds=<optimized out>, nfds=<optimized out>, timeout=<optimized out>) at ../sysdeps/unix/sysv/linux/poll.c:87
#1  0x00007fcc29774a0a in ?? () from /usr/lib/x86_64-linux-gnu/libavahi-common.so.3
#2  0x00007fcc297744fb in avahi_simple_poll_run () from /usr/lib/x86_64-linux-gnu/libavahi-common.so.3
#3  0x00007fcc297746e8 in avahi_simple_poll_iterate () from /usr/lib/x86_64-linux-gnu/libavahi-common.so.3
#4  0x00007fcc2977491d in avahi_simple_poll_loop () from /usr/lib/x86_64-linux-gnu/libavahi-common.so.3
#5  0x00007fcc2977499c in ?? () from /usr/lib/x86_64-linux-gnu/libavahi-common.so.3
#6  0x00007fcc48735e9a in start_thread (arg=0x7fcc2955b700) at pthread_create.c:308
#7  0x00007fcc4b8ce4bd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#8  0x0000000000000000 in ?? ()

Thread 2 (Thread 0x7fcc3cb0a700 (LWP 17973)):
#0  0x00007fcc4b8c2b03 in __GI___poll (fds=<optimized out>, nfds=<optimized out>, timeout=<optimized out>) at ../sysdeps/unix/sysv/linux/poll.c:87
#1  0x00007fcc48269036 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007fcc48269164 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007fcc4c043426 in QEventDispatcherGlib::processEvents (this=0x7fcc30057640, flags=...) at kernel/qeventdispatcher_glib.cpp:426
#4  0x00007fcc4c012c82 in QEventLoop::processEvents (this=<optimized out>, flags=...) at kernel/qeventloop.cpp:149
#5  0x00007fcc4c012ed7 in QEventLoop::exec (this=0x7fcc3cb09dd0, flags=...) at kernel/qeventloop.cpp:204
#6  0x00007fcc4bf11fa7 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:501
#7  0x00007fcc4bff29ff in QInotifyFileSystemWatcherEngine::run (this=0x209ff00) at io/qfilesystemwatcher_inotify.cpp:248
#8  0x00007fcc4bf14fcb in QThreadPrivate::start (arg=0x209ff00) at thread/qthread_unix.cpp:298
#9  0x00007fcc48735e9a in start_thread (arg=0x7fcc3cb0a700) at pthread_create.c:308
#10 0x00007fcc4b8ce4bd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#11 0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7fcc4e68d780 (LWP 17526)):
[KCrash Handler]
#6  0x00007fcc4ddc6c9a in KSaneIface::KSaneWidget::toQImageSilent (this=0x1cdd5f0, data=..., width=<optimized out>, height=<optimized out>, bytes_per_line=2457, format=KSaneIface::KSaneWidget::FormatGrayScale8) at ../../libksane/ksane_widget.cpp:557
#7  0x00007fcc4ddc6e57 in KSaneIface::KSaneWidget::toQImage (this=0x1cdd5f0, data=..., width=<optimized out>, height=<optimized out>, bytes_per_line=<optimized out>, format=KSaneIface::KSaneWidget::FormatGrayScale8) at ../../libksane/ksane_widget.cpp:637
#8  0x000000000040c69a in Skanlite::saveImage (this=0x1ce0a80) at /build/buildd/skanlite-0.8/src/skanlite.cpp:420
#9  0x000000000040c8a9 in Skanlite::imageReady (this=0x1ce0a80, data=..., w=2457, h=3405, bpl=2457, f=1) at /build/buildd/skanlite-0.8/src/skanlite.cpp:316
#10 0x000000000040d22f in Skanlite::qt_metacall (this=0x1ce0a80, _c=QMetaObject::InvokeMetaMethod, _id=<optimized out>, _a=0x7fffdc2fc670) at /build/buildd/skanlite-0.8/obj-x86_64-linux-gnu/src/skanlite.moc:92
#11 0x00007fcc4c028489 in QMetaObject::activate (sender=0x1cdd5f0, m=<optimized out>, local_signal_index=<optimized out>, argv=0x7fffdc2fc670) at kernel/qobject.cpp:3566
#12 0x00007fcc4ddc39e9 in KSaneIface::KSaneWidget::imageReady (this=<optimized out>, _t1=..., _t2=2457, _t3=3405, _t4=2457, _t5=1) at ./ksane.moc:123
#13 0x00007fcc4ddcefbd in KSaneIface::KSaneWidgetPrivate::oneFinalScanDone (this=0x1ce4a40) at ../../libksane/ksane_widget_private.cpp:912
#14 0x00007fcc4c02d446 in QObject::event (this=0x1ce4a40, e=<optimized out>) at kernel/qobject.cpp:1195
#15 0x00007fcc4ca0e894 in notify_helper (e=0x7fcc1c0026c0, receiver=0x1ce4a40, this=0x1b685b0) at kernel/qapplication.cpp:4559
#16 QApplicationPrivate::notify_helper (this=0x1b685b0, receiver=0x1ce4a40, e=0x7fcc1c0026c0) at kernel/qapplication.cpp:4531
#17 0x00007fcc4ca13713 in QApplication::notify (this=0x7fffdc2fd1d0, receiver=0x1ce4a40, e=0x7fcc1c0026c0) at kernel/qapplication.cpp:4420
#18 0x00007fcc4d7489e6 in KApplication::notify (this=0x7fffdc2fd1d0, receiver=0x1ce4a40, event=0x7fcc1c0026c0) at ../../kdeui/kernel/kapplication.cpp:311
#19 0x00007fcc4c013e9c in QCoreApplication::notifyInternal (this=0x7fffdc2fd1d0, receiver=0x1ce4a40, event=0x7fcc1c0026c0) at kernel/qcoreapplication.cpp:876
#20 0x00007fcc4c017c6a in sendEvent (event=0x7fcc1c0026c0, receiver=0x1ce4a40) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231
#21 QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x1b42ff0) at kernel/qcoreapplication.cpp:1500
#22 0x00007fcc4c042f93 in sendPostedEvents () at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:236
#23 postEventSourceDispatch (s=<optimized out>) at kernel/qeventdispatcher_glib.cpp:279
#24 0x00007fcc48268d53 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#25 0x00007fcc482690a0 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#26 0x00007fcc48269164 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#27 0x00007fcc4c0433bf in QEventDispatcherGlib::processEvents (this=0x1b444b0, flags=...) at kernel/qeventdispatcher_glib.cpp:424
#28 0x00007fcc4cab6d5e in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#29 0x00007fcc4c012c82 in QEventLoop::processEvents (this=<optimized out>, flags=...) at kernel/qeventloop.cpp:149
#30 0x00007fcc4c012ed7 in QEventLoop::exec (this=0x7fffdc2fd160, flags=...) at kernel/qeventloop.cpp:204
#31 0x00007fcc4c017f67 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1148
#32 0x000000000040a34e in main (argc=5, argv=0x7fffdc2fd628) at /build/buildd/skanlite-0.8/src/main.cpp:84

Reported using DrKonqi
Comment 1 Kåre Särs 2012-07-22 19:23:42 UTC
Thanks for the report.

It would be nice to know what scanner and backend (driver) you are using. I suspect the backend is mis behaving  a bit, but it would be good to know how ;)

I still need to add an extra check in libksane for it. Are you able to compile and test a path?

/Kåre
Comment 2 tmp 2012-07-23 18:19:59 UTC
Hi Kare,

it's an HP Officejet 6310 connected via Ethernet.  For access I use HPLIP 
3.12.2, which should be standard with Kubuntu 12.04. I should mention that it 
works well with xsane 0.998.

I am theoretically able to do some compilation, but to be honest, this kind 
of 
stuff messes up your harddisk and is furthermore quite time consuming (as I 
don't do it regularly). I am afraid that doesn't fit my family's holiday 
plans...

Regards
Carsten

Am Sonntag, 22. Juli 2012, 19:23:42 schrieben Sie:
> https://bugs.kde.org/show_bug.cgi?id=303867
> 
> Kåre Särs <kare.sars@iki.fi> changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
> Status|UNCONFIRMED                 |NEW
>      Ever confirmed|0                           |1
> 
> --- Comment #1 from Kåre Särs <kare.sars@iki.fi> ---
> Thanks for the report.
> 
> It would be nice to know what scanner and backend (driver) you are using. I
> suspect the backend is mis behaving  a bit, but it would be good to know how
> ;)
> 
> I still need to add an extra check in libksane for it. Are you able to
> compile and test a path?
> 
> /Kåre
Comment 3 Kåre Särs 2012-07-23 19:01:41 UTC
OK

I know how it is :)

What I would like to know is if the backend only returns more data than expexted or if it also has padding on every line so that I would ned to remve those too to get a proper image.

Can you run skanlite with debug printouts for hplip?

SANE_DEBUG_HPLIP=16 skanlite

There should be some line that contains something like "bytes per line" and another with "width". If you do not get it, try increasing the debug number.

If it has padding on a line it might be that the bytes per line is in multiples of 4 so the width of the scan selection should not be a multiple of 4 if possible.

Thanks,
   Kåre
Comment 4 tmp 2012-08-02 13:48:04 UTC
Hi Kare,

I've tried again several times and now it works without problem. First, I got 
a segmentation fault, the next try the printer switched off itself, but now, 
for the last 5 or so tries, I could save the scanned document. Probably this 
is quite a bad situation for hunting bugs...

Regards,
Carsten

Am Montag, 23. Juli 2012, 19:01:41 schrieben Sie:
> https://bugs.kde.org/show_bug.cgi?id=303867
> 
> --- Comment #3 from Kåre Särs <kare.sars@iki.fi> ---
> OK
> 
> I know how it is :)
> 
> What I would like to know is if the backend only returns more data than
> expexted or if it also has padding on every line so that I would ned to
> remve those too to get a proper image.
> 
> Can you run skanlite with debug printouts for hplip?
> 
> SANE_DEBUG_HPLIP=16 skanlite
> 
> There should be some line that contains something like "bytes per line" and
> another with "width". If you do not get it, try increasing the debug number.
> 
> If it has padding on a line it might be that the bytes per line is in
> multiples of 4 so the width of the scan selection should not be a multiple
> of 4 if possible.
> 
> Thanks,
>    Kåre
Comment 5 Kåre Särs 2012-08-02 18:36:59 UTC
Hi Carsten,

It is not the best situation, but I suspect that the bug is that libksane does not handle padded lines properly.

Did you try to change the scan selection width one pixel at a time? (in 8 bit grayscale mode)?

If you don't get it to crash and the picture isn't distorted, I guess we can't do to much...

Regards,
  Kåre
Comment 6 tmp 2012-08-02 21:08:36 UTC
Hi Kare,

yes, that's what I tried. Works like a charme - I just tried again. Anyway, I 
won't complain if there is NO bug..... Thanks for your help!

Regards
Carsten

Am Donnerstag, 2. August 2012, 18:36:59 schrieben Sie:
> https://bugs.kde.org/show_bug.cgi?id=303867
> 
> --- Comment #5 from Kåre Särs <kare.sars@iki.fi> ---
> Hi Carsten,
> 
> It is not the best situation, but I suspect that the bug is that libksane
> does not handle padded lines properly.
> 
> Did you try to change the scan selection width one pixel at a time? (in 8
> bit grayscale mode)?
> 
> If you don't get it to crash and the picture isn't distorted, I guess we
> can't do to much...
> 
> Regards,
>   Kåre
Comment 7 Kåre Särs 2013-02-11 16:11:17 UTC
Hi,

The crash should be fixed, but I'm not sure if the line padding is going to cause problems. Could you try when 4.10.1 comes out?

This bug is similar to bug 304727

Thanks,
  Kåre
Comment 8 Andrew Crouthamel 2018-09-24 02:16:39 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 set the bug status 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 9 Andrew Crouthamel 2018-10-27 04:14:24 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 30 days. The bug is now 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

Thank you for helping us make KDE software even better for everyone!