Bug 281207 - Save dialog in skanlite and kolourpaint hangs
Summary: Save dialog in skanlite and kolourpaint hangs
Status: RESOLVED UNMAINTAINED
Alias: None
Product: kio
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 4.10.5
Platform: Arch Linux Linux
: LO minor
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
: 295394 322524 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-09-02 10:49 UTC by Roland Leißa
Modified: 2018-04-20 22:05 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
screenshot (802.02 KB, image/png)
2011-09-04 12:50 UTC, Roland Leißa
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roland Leißa 2011-09-02 10:49:28 UTC
Version:           unspecified (using KDE 4.7.0) 
OS:                Linux

Since I encoutered this bug in kolourpaint and skanlite, I think it's a problem in libksane.

Reproducible: Always

Steps to Reproduce:
* fire up kolourpaint or skanlite
* press scan
* as soon as the saving dialog pop ups, this dialog hangs


Expected Results:  
the user should be able to save the image
Comment 1 Kåre Särs 2011-09-02 11:22:07 UTC
Need some more info ;)

Backend, scanning DPI, scan size and color depth

Are you scanning a big image? Could it be that memory runs out and the computer starts to swap?

What distro?

Regards,
  Kåre
Comment 2 Roland Leißa 2011-09-04 12:47:50 UTC
i'm running archlinux.
this is my lsusb output:

Bus 001 Device 004: ID 04a9:220e Canon, Inc. CanoScan N1240U/LiDE 30

Scanner works fine in libreoffice.

Memory shouldn't be a problem.

The depth/color/DPI settings do not matter. Bug happens every time.
Comment 3 Roland Leißa 2011-09-04 12:50:26 UTC
Created attachment 63371 [details]
screenshot

this is what happens.
Comment 4 Roland Leißa 2011-09-04 12:54:42 UTC
Ok, just found out that after waiting for about two minutes the saving dialog becomes responsive again.
Comment 5 Roland Leißa 2011-09-06 23:20:12 UTC
hmm, this seems to be a general performance bug. Saving a png grayscale image (5,5 MB size) takes also a couple of minutes on my system.
Comment 6 Kåre Särs 2011-09-07 06:07:56 UTC
Thanks fo the updates. It could be that there is some network KIO timing-out or similar... But that is just a wild guess.

But from what it seems it is not libksane, but the save dialog that generates the delay/freeze.

You could check the processor/memory load to see if any of them are maxdout...

I'm going to resolve this. I'm afraid I don't know how to help here :(

You could ask on IRC if somebody there has has similar problems...
Comment 7 Kåre Särs 2011-09-07 06:09:04 UTC
A list of IRC channels:
http://userbase.kde.org/IRC_Channels
Comment 8 Frank Steinmetzger 2012-03-05 23:43:46 UTC
*** Bug 295394 has been marked as a duplicate of this bug. ***
Comment 9 quazgar 2013-08-19 20:50:12 UTC
Reopening since I can still reproduce this problem with Skanlite 1.0 on KDE 4.10.5 (Gentoo Linux). I did not experience this bug with any other KDE program's file save dialog, so I do not think it's an upstream problem (unless someone can come up with a similar problem in another program).

If there is something I can do to help with this bug, I am happy to help.
Comment 10 quazgar 2013-08-19 20:56:53 UTC
*** Bug 322524 has been marked as a duplicate of this bug. ***
Comment 11 quazgar 2013-08-19 20:58:26 UTC
There seems to be relevant error output in bug 322524.
Comment 12 quazgar 2013-08-19 21:24:44 UTC
Specifically, my .xsession-errors tells me the following lines just when the save dialog starts freezing:

Skanlite(19941): couldn't create slave: "Unable to create io-slave:
klauncher said: Unknown protocol ''.
" 

After that, bit by bit, the following lines appeared, until, after the last "Unable to create io-slave", the file dialog becomes usable again:

QProcess: Destroyed while process is still running.
Skanlite(19941) KSambaSharePrivate::testparmParamValue: We got some errors while running testparm "Load smb config files from /etc/samba/smb.conf
Error loading services.
" 
Skanlite(19941) KSambaSharePrivate::findSmbConf: KSambaShare: Could not find smb.conf! 
QProcess: Destroyed while process is still running.
Skanlite(19941): couldn't create slave: "Unable to create io-slave:
klauncher said: Unknown protocol ''.
" 

I hope this helps.
Comment 13 quazgar 2013-08-19 23:22:57 UTC
The first "Unknown protocol ''." message appears at line 366 of skanlite.cpp:m_saveDialog->setMimeFilter(filterList, "image/"+type);
the hanging file dialog at line 369:
m_saveDialog->exec()
Comment 14 Kåre Särs 2013-08-20 05:22:22 UTC
Thanks Daniel for taking the time to investigate!

I'm reassigning this bug to kio. I hope it is the right place ;)

/Kåre
Comment 15 quazgar 2013-08-20 21:12:58 UTC
Yes, maybe :-)

According to ths bug trace, taken of some point during the hanging, it looks like a problem with Samba.  Maybe KDE looks for smb shares on the network to display in the file dialog and only responds after some timeout?  I am just wondering how to prevent that and what other KDE apps do here.  Unfortunately I know nothing about the appropriate KDE file dialog classes etc.

#0  0x00007ffff4049783 in select () from /lib64/libc.so.6
#1  0x00007ffff4ee3b0f in qt_safe_select(int, fd_set*, fd_set*, fd_set*, timeval const*) () from /usr/lib64/qt4/libQtCore.so.4
#2  0x00007ffff4e91e48 in ?? () from /usr/lib64/qt4/libQtCore.so.4
#3  0x00007ffff4e93713 in ?? () from /usr/lib64/qt4/libQtCore.so.4
#4  0x00007ffff4e4d61d in QProcess::waitForFinished(int) () from /usr/lib64/qt4/libQtCore.so.4
#5  0x00007ffff7ad5905 in ?? () from /usr/lib64/libkio.so.5
#6  0x00007ffff7ad81fc in ?? () from /usr/lib64/libkio.so.5
#7  0x00007ffff7ad882b in ?? () from /usr/lib64/libkio.so.5
#8  0x00007ffff7ad88dd in ?? () from /usr/lib64/libkio.so.5
#9  0x00007ffff7ad8926 in KSambaShare::KSambaShare() () from /usr/lib64/libkio.so.5
#10 0x00007ffff7ad89b6 in KSambaShare::instance() () from /usr/lib64/libkio.so.5
#11 0x00007ffff7a52953 in KFileItem::overlays() const () from /usr/lib64/libkio.so.5
#12 0x00007ffff7a428c2 in KDirModel::data(QModelIndex const&, int) const () from /usr/lib64/libkio.so.5
#13 0x00007ffff63304cc in QSortFilterProxyModel::data(QModelIndex const&, int) const () from /usr/lib64/qt4/libQtGui.so.4
#14 0x00007ffff7a62ae7 in KFileItemDelegate::Private::decoration(QStyleOptionViewItemV4 const&, QModelIndex const&) const () from /usr/lib64/libkio.so.5
#15 0x00007ffff7a62ffa in KFileItemDelegate::Private::initStyleOption(QStyleOptionViewItemV4*, QModelIndex const&) const () from /usr/lib64/libkio.so.5
#16 0x00007ffff7a666bb in KFileItemDelegate::sizeHint(QStyleOptionViewItem const&, QModelIndex const&) const () from /usr/lib64/libkio.so.5
#17 0x00007ffff62cae88 in ?? () from /usr/lib64/qt4/libQtGui.so.4
#18 0x00007ffff62d71dd in ?? () from /usr/lib64/qt4/libQtGui.so.4
#19 0x00007ffff62ca7bf in ?? () from /usr/lib64/qt4/libQtGui.so.4
#20 0x00007ffff62ca917 in QListView::doItemsLayout() () from /usr/lib64/qt4/libQtGui.so.4
#21 0x00007ffff62b54f4 in QAbstractItemView::event(QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#22 0x00007ffff5db68c4 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#23 0x00007ffff5dbb5a3 in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#24 0x00007ffff6ad83f6 in KApplication::notify(QObject*, QEvent*) () from /usr/lib64/libkdeui.so.5
#25 0x00007ffff4eb8543 in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib64/qt4/libQtCore.so.4
#26 0x00007ffff5e08988 in QWidgetPrivate::show_helper() () from /usr/lib64/qt4/libQtGui.so.4
#27 0x00007ffff5e08c72 in QWidget::setVisible(bool) () from /usr/lib64/qt4/libQtGui.so.4
#28 0x00007ffff61f2f5e in ?? () from /usr/lib64/qt4/libQtGui.so.4
#29 0x00007fffdfd9a8b6 in KDirOperator::setView(QAbstractItemView*) () from /usr/lib64/libkfile.so.4
#30 0x00007fffdfd93c68 in KDirOperator::setView(KFile::FileView) () from /usr/lib64/libkfile.so.4
#31 0x00007fffdfda7f53 in KFileWidget::showEvent(QShowEvent*) () from /usr/lib64/libkfile.so.4
#32 0x00007ffff5e06b81 in QWidget::event(QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#33 0x00007ffff5db68c4 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#34 0x00007ffff5dbb5a3 in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#35 0x00007ffff6ad83f6 in KApplication::notify(QObject*, QEvent*) () from /usr/lib64/libkdeui.so.5
#36 0x00007ffff4eb8543 in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib64/qt4/libQtCore.so.4
#37 0x00007ffff5e08988 in QWidgetPrivate::show_helper() () from /usr/lib64/qt4/libQtGui.so.4
#38 0x00007ffff5e08c72 in QWidget::setVisible(bool) () from /usr/lib64/qt4/libQtGui.so.4
#39 0x00007ffff5e087fe in QWidgetPrivate::showChildren(bool) () from /usr/lib64/qt4/libQtGui.so.4
#40 0x00007ffff5e0887d in QWidgetPrivate::show_helper() () from /usr/lib64/qt4/libQtGui.so.4
#41 0x00007ffff5e08c72 in QWidget::setVisible(bool) () from /usr/lib64/qt4/libQtGui.so.4
#42 0x00007ffff625854c in QDialog::setVisible(bool) () from /usr/lib64/qt4/libQtGui.so.4
#43 0x00007ffff6257320 in QDialog::exec() () from /usr/lib64/qt4/libQtGui.so.4
#44 0x000000000040dadc in Skanlite::saveImage (this=0x8cf640) at /data-bak/daniel/building/skanlite/src/skanlite.cpp:376
Comment 16 bones_was_here 2015-03-09 04:49:53 UTC
On Debian 8, having package "samba" installed causes the skanlite save dialogue to hang for a few minutes, regardless of whether smbd and nmbd are running.  Removing (not purging) samba causes skanlite to display save dialogues immediately.  Browsing of samba shares works fairly responsively both with and without the samba server installed.  Adding the user to sambashare group does not help.

$ samba -V
Version 4.1.17-Debian
$ skanlite -v
Qt: 4.8.6
KDE Development Platform: 4.14.2
Skanlite: 1.0
$ cat /etc/debian_version
8.0
Comment 17 Chris 2015-07-30 17:15:15 UTC
This is one of those annoying bugs that has gone on for WAY too many years. Come on guys. Using strace I see skanlite looks for the smbd binary ("/usr/sbin/smbd" on ubuntu). If it finds it then it forks off a child process. Later than child process either crashes or dies sending SIGCHLD. However, the parent process doesn't appear to recognize that its child dies and hangs in select() for a long time waiting for the child to return data.

If I get time I will look at the source to figure out what's it's actually doing but it might take me a while. A core developer could probably solve this in 15 minutes if they cared. I'm running Ubuntu 14.04 and MATE desktop.
Qt: 4.8.6
KDE Development Platform: 4.13.3
Skanlite: 1.1

If anyone needs to temporarily "solve" the issue then just hide your smbd binary and the file dialog will no longer hang.
Comment 18 Chris 2015-07-30 21:04:45 UTC
I have found the (incredibly simple) problem with this and patched it. Should I share my findings? I'm thinking, not. Otherwise how will they learn. They don't care about us, I don't care about them. So fix it yourself, you lazy bastards. It's literally a quite obvious bug and 5 minute fix if anyone actually took the time to examine the issue and this could have been fixed *years* ago.  Fact is, these guys could care less, so fark them. My patch is working great so I'm happy.
Comment 19 Christoph Feck 2015-09-24 00:02:06 UTC
> A core developer could probably solve this in 15 minutes if they cared.

s/cared/could reproduce
Comment 20 Nate Graham 2018-04-20 22:05:02 UTC
(In reply to Chris from comment #18)
> I have found the (incredibly simple) problem with this and patched it.
> Should I share my findings? I'm thinking, not. Otherwise how will they
> learn. They don't care about us, I don't care about them. So fix it
> yourself, you lazy bastards. It's literally a quite obvious bug and 5 minute
> fix if anyone actually took the time to examine the issue and this could
> have been fixed *years* ago.  Fact is, these guys could care less, so fark
> them. My patch is working great so I'm happy.

In open-source development, work is done and shared by those who care. You did the first part, but forgot the second part. As a result, nobody since then has been able to benefit from your work. What a shame.

Since this bug describes a problem with the Qt4 version of the software, and I can't reproduce it with Skanlite and my Plasma 5 machine that has Samba installed, I'm closing it. If you can still reproduce it in such an environment, please feel free to share your patch! The world gets better only when we work to improve it...