Bug 165485 - Crash when dragging and dropping from sftp kioslave to places bar
Summary: Crash when dragging and dropping from sftp kioslave to places bar
Status: RESOLVED FIXED
Alias: None
Product: kio
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR crash (vote)
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
: 171130 172645 178769 190914 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-07-01 15:25 UTC by Ivo Anjo
Modified: 2009-04-28 14:56 UTC (History)
10 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ivo Anjo 2008-07-01 15:25:46 UTC
Version:            (using KDE 4.0.83)
Installed from:    Unlisted Binary Package
OS:                Linux

Not sure if this is dolphin or kdelibs, but when I drag a folder from a sftp kioslave to the places bar on dolphin, it crashes.

Backtrace:
Application: Dolphin (dolphin), signal SIGABRT
KDE4Daily is generating a backtrace - please be patient :)
KDESVNTRUNKr825042
------

[Thread debugging using libthread_db enabled]
[New Thread 0xb6009720 (LWP 4717)]
0xb7fdc402 in __kernel_vsyscall ()

#1  0xb640ccb6 in nanosleep () from /lib/tls/i686/cmov/libc.so.6

#2  0xb640cac7 in sleep () from /lib/tls/i686/cmov/libc.so.6

#3  0xb7aaab0b in KCrash::startDrKonqi (argv=0xbfe38f34, argc=17) at /home/kde4daily/src/kdelibs/kdeui/util/kcrash.cpp:361

#4  0xb7aab382 in KCrash::defaultCrashHandler (sig=6) at /home/kde4daily/src/kdelibs/kdeui/util/kcrash.cpp:286

#6  0xb7fdc402 in __kernel_vsyscall ()

#7  0xb63a2085 in raise () from /lib/tls/i686/cmov/libc.so.6

#8  0xb63a3a01 in abort () from /lib/tls/i686/cmov/libc.so.6

#9  0xb7e27895 in qt_message_output () from /home/kde4daily/install/qt-copy/lib/libQtCore.so.4

#10 0xb7e27919 in qFatal () from /home/kde4daily/install/qt-copy/lib/libQtCore.so.4

#11 0xb7e27d71 in qt_assert () from /home/kde4daily/install/qt-copy/lib/libQtCore.so.4

#12 0xb75776f7 in KSharedPtr<KMimeType>::operator-> (this=0xbfe3b62c) at /home/kde4daily/src/kdelibs/kdecore/util/ksharedptr.h:116

#13 0xb7596eee in KFilePlacesModel::dropMimeData (this=0x81741e8, data=0x8425950, action=Qt::MoveAction, row=-1, column=-1, parent=@0xbfe3b6c0) at /home/kde4daily/src/kdelibs/kfile/kfileplacesmodel.cpp:557

#14 0xb717ae4a in QAbstractItemView::dropEvent () from /home/kde4daily/install/qt-copy/lib/libQtGui.so.4

#15 0xb7199c0a in QListView::dropEvent () from /home/kde4daily/install/qt-copy/lib/libQtGui.so.4

#16 0xb75a038d in KFilePlacesView::dropEvent (this=0x8239790, event=0xbfe3bf7c) at /home/kde4daily/src/kdelibs/kfile/kfileplacesview.cpp:589

#17 0xb6cd2861 in QWidget::event () from /home/kde4daily/install/qt-copy/lib/libQtGui.so.4

#18 0xb7040048 in QFrame::event () from /home/kde4daily/install/qt-copy/lib/libQtGui.so.4

#19 0xb70d748d in QAbstractScrollArea::viewportEvent () from /home/kde4daily/install/qt-copy/lib/libQtGui.so.4

#20 0xb717a159 in QAbstractItemView::viewportEvent () from /home/kde4daily/install/qt-copy/lib/libQtGui.so.4

#21 0xb70d9f7a in QAbstractScrollAreaPrivate::viewportEvent () from /home/kde4daily/install/qt-copy/lib/libQtGui.so.4

#22 0xb70d9fac in QAbstractScrollAreaFilter::eventFilter () from /home/kde4daily/install/qt-copy/lib/libQtGui.so.4

#23 0xb7f24a18 in QCoreApplicationPrivate::sendThroughObjectEventFilters () from /home/kde4daily/install/qt-copy/lib/libQtCore.so.4

#24 0xb6c747f7 in QApplicationPrivate::notify_helper () from /home/kde4daily/install/qt-copy/lib/libQtGui.so.4

#25 0xb6c763a6 in QApplication::notify () from /home/kde4daily/install/qt-copy/lib/libQtGui.so.4

#26 0xb7a441e3 in KApplication::notify (this=0xbfe3e29c, receiver=0x823abf8, event=0xbfe3bf7c) at /home/kde4daily/src/kdelibs/kdeui/kernel/kapplication.cpp:311

#27 0xb7f2668a in QCoreApplication::notifyInternal () from /home/kde4daily/install/qt-copy/lib/libQtCore.so.4

#28 0xb7f2a1c9 in QCoreApplication::sendEvent () from /home/kde4daily/install/qt-copy/lib/libQtCore.so.4

#29 0xb6cfd0f9 in QX11Data::xdndHandleDrop () from /home/kde4daily/install/qt-copy/lib/libQtGui.so.4

#30 0xb6cfd4b3 in QDragManager::drop () from /home/kde4daily/install/qt-copy/lib/libQtGui.so.4

#31 0xb6d001eb in QDragManager::eventFilter () from /home/kde4daily/install/qt-copy/lib/libQtGui.so.4

#32 0xb7f24aef in QCoreApplicationPrivate::sendThroughApplicationEventFilters () from /home/kde4daily/install/qt-copy/lib/libQtCore.so.4

#33 0xb6c746c4 in QApplicationPrivate::notify_helper () from /home/kde4daily/install/qt-copy/lib/libQtGui.so.4

#34 0xb6c752f1 in QApplication::notify () from /home/kde4daily/install/qt-copy/lib/libQtGui.so.4

#35 0xb7a441e3 in KApplication::notify (this=0xbfe3e29c, receiver=0x8440c48, event=0xbfe3c548) at /home/kde4daily/src/kdelibs/kdeui/kernel/kapplication.cpp:311

#36 0xb7f2668a in QCoreApplication::notifyInternal () from /home/kde4daily/install/qt-copy/lib/libQtCore.so.4

#37 0xb6c80669 in QCoreApplication::sendSpontaneousEvent () from /home/kde4daily/install/qt-copy/lib/libQtGui.so.4

#38 0xb6c79166 in QApplicationPrivate::sendMouseEvent () from /home/kde4daily/install/qt-copy/lib/libQtGui.so.4

#39 0xb6cf3221 in QETWidget::translateMouseEvent () from /home/kde4daily/install/qt-copy/lib/libQtGui.so.4

#40 0xb6cf08be in QApplication::x11ProcessEvent () from /home/kde4daily/install/qt-copy/lib/libQtGui.so.4

#41 0xb6d1cefd in x11EventSourceDispatch () from /home/kde4daily/install/qt-copy/lib/libQtGui.so.4

#42 0xb62efbf8 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0

#43 0xb62f2e5e in __ () from /usr/lib/libglib-2.0.so.0

#44 0x080c2bf8 in __ ()

#45 0x00000000 in __ ()
Comment 1 Peter Penz 2008-07-01 21:44:50 UTC
Crash confirmed. It works with FTP but not with SFTP.

@Kevin: I could fix the crash by checking whether the returned mimetype pointer is null, but the problem is that the place won't be added in this case... What should we do if
 KMimeType::Ptr mimetype = KMimeType::mimeType(KIO::NetAccess::mimetype(url, 0));
returns 0? Or might this be an issue in the SFTP slave and each slave must be able to return a mimetype?
Comment 2 Kevin Ottens 2008-07-02 12:00:25 UTC
> Or might this be an issue in the SFTP slave and each slave must be able to
> return a mimetype?


Double checked with David, it's a bug in the sftp slave.
Comment 3 Rui G. 2008-08-01 16:05:24 UTC
I can still confirm it in kde 4.1 both Opensuse 11.0 and Kubuntu 8.04.1
Comment 4 andrea zucchelli 2008-08-01 16:12:19 UTC
I've the same problem on archlinux
Comment 5 Jonathan Thomas 2008-08-21 15:21:01 UTC
Noting that adding a local folder to Places, then changing to sftp works ok.
Comment 6 Frank Reininghaus 2008-10-13 20:15:50 UTC
*** Bug 171130 has been marked as a duplicate of this bug. ***
Comment 7 Frank Reininghaus 2008-10-13 20:17:26 UTC
*** Bug 172645 has been marked as a duplicate of this bug. ***
Comment 8 Simon St James 2008-10-15 20:06:23 UTC
Ah - I just did the "check for NULL mimetype" "fix" here:

http://websvn.kde.org/?view=rev&revision=871810

in response to 

http://bugs.kde.org/show_bug.cgi?id=170927 

but now that I've read the comments here, I wonder if this was the right move.  In the case of BUG:170927, though, we're dealing with a URL that doesn't exist, and so presumably can't have a mimetype.  Should I leave it, revert it, kDebug() a warning, ... ? :)
Comment 9 Kevin Ottens 2008-10-15 22:20:22 UTC
I'd be tempted to say "revert" since AFAIK this problem is triggered by a bug in the ioslave... OTOH the said ioslave isn't fixed yet, and we probably want to avoid a crash.

So let's keep your modification in, just please add a kWarning() call before the "continue;" in the if(). Not exactly ideal since URLs won't get added in this case, and the user won't have a clear feedback, but that's still better than a crash.
Comment 10 Simon St James 2008-10-15 22:38:49 UTC
SVN commit 871866 by sstjames:

At least log a kWarning() when the mimetype cannot be resolved rather than failing completely silently, as requested by ervin.

CCBUG:165485

 M  +3 -1      kfileplacesmodel.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=871866
Comment 11 David Faure 2008-10-16 02:17:38 UTC
I don't see what's the kioslave bug there. You ask for the mimetype of a url that doesn't exist, you get an empty string. What is wrong is to do KMimeType::mimeType(empty string). Well, you can do it, but you'd better check for NULL indeed ;)
Comment 12 Alexander Wauck 2008-12-05 17:56:22 UTC
In SVN trunk, I get this debug message:
dolphin(7880) KFilePlacesModel::dropMimeData: URL not added to Places as mimetype could not be determined!

I assume that's what was added in the aforementioned commit.  Do we know why the mimetype can't be determined?  Why can it be determined on FTP but not SFTP?  If nobody knows, I guess I could go dig through the code and try to find out.
Comment 13 Jonathan Thomas 2008-12-28 04:00:58 UTC
*** Bug 178769 has been marked as a duplicate of this bug. ***
Comment 14 David Faure 2009-01-08 12:58:36 UTC
SVN commit 907549 by dfaure:

Fix implementation of mimetype() command so that it shares more code with get(), which
 - fixes the lack of ERR_IS_DIRECTORY handling (#165485)
 - actually emits the mimetype, for files ;-)
Will backport for 4.2.
BUG: 165485


 M  +11 -27    kio_sftp.cpp  
 M  +7 -6      kio_sftp.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=907549
Comment 15 missive 2009-01-24 17:12:19 UTC
Is it possible that a similar fix could handle Bug 169906?

I never saw a crash, but as of r915653 it is still not possible to drag a webdavs URL to the places bar.
Comment 16 Dario Andres 2009-04-28 14:56:13 UTC
*** Bug 190914 has been marked as a duplicate of this bug. ***