Bug 171117 - Konqueror crashes if a string containing '#' and a letter is pasted into the window with a middle-click
Summary: Konqueror crashes if a string containing '#' and a letter is pasted into the ...
Status: RESOLVED FIXED
Alias: None
Product: kio
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-15 19:28 UTC by Daniel Dumitrache
Modified: 2008-09-29 20:31 UTC (History)
1 user (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 Daniel Dumitrache 2008-09-15 19:28:53 UTC
Version:            (using KDE 4.1.1)
OS:                Linux
Installed from:    Ubuntu Packages

Konqueror crashes when doing a middle click if the clipboard contains this string: "/#inbox"

here's the backtrace:

Application: Konqueror (konqueror), signal SIGABRT
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
[New Thread 0xb60e2940 (LWP 8036)]
(no debugging symbols found)
[KCrash handler]
#6  0xb7fc0410 in __kernel_vsyscall ()
#7  0xb7daa085 in raise () from /lib/tls/i686/cmov/libc.so.6
#8  0xb7daba01 in abort () from /lib/tls/i686/cmov/libc.so.6
#9  0xb73fa367 in qt_message_output () from /usr/lib/libQtCore.so.4
#10 0xb73fa458 in qFatal () from /usr/lib/libQtCore.so.4
#11 0xb73fa505 in qt_assert () from /usr/lib/libQtCore.so.4
#12 0xb7bc4ed0 in ?? () from /usr/lib/kde4/lib/libkio.so.5
#13 0xb7bc4f9a in KDirModel::qt_metacall () from /usr/lib/kde4/lib/libkio.so.5
#14 0xb7502f79 in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#15 0xb7503642 in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#16 0xb7bae2c3 in KDirLister::newItems () from /usr/lib/kde4/lib/libkio.so.5
#17 0xb7bae89a in KDirLister::Private::emitItems ()
   from /usr/lib/kde4/lib/libkio.so.5
#18 0xb7bb3095 in ?? () from /usr/lib/kde4/lib/libkio.so.5
#19 0xb7bb86b8 in ?? () from /usr/lib/kde4/lib/libkio.so.5
#20 0xb7502f79 in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#21 0xb7503642 in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#22 0xb7b8d2d9 in KIO::ListJob::entries () from /usr/lib/kde4/lib/libkio.so.5
#23 0xb7b961f7 in ?? () from /usr/lib/kde4/lib/libkio.so.5
#24 0xb7b966b2 in KIO::ListJob::qt_metacall ()
   from /usr/lib/kde4/lib/libkio.so.5
#25 0xb7502f79 in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#26 0xb7503642 in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#27 0xb7c32d43 in KIO::SlaveInterface::listEntries ()
   from /usr/lib/kde4/lib/libkio.so.5
#28 0xb7c34f49 in KIO::SlaveInterface::dispatch ()
   from /usr/lib/kde4/lib/libkio.so.5
#29 0xb7c3541d in KIO::SlaveInterface::dispatch ()
   from /usr/lib/kde4/lib/libkio.so.5
#30 0xb7c27fd7 in KIO::Slave::gotInput () from /usr/lib/kde4/lib/libkio.so.5
#31 0xb7c293ad in KIO::Slave::qt_metacall ()
   from /usr/lib/kde4/lib/libkio.so.5
#32 0xb7502f79 in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#33 0xb7503642 in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#34 0xb7b647c7 in KIO::Connection::readyRead ()
   from /usr/lib/kde4/lib/libkio.so.5
#35 0xb7b65638 in ?? () from /usr/lib/kde4/lib/libkio.so.5
#36 0xb7b6647e in KIO::Connection::qt_metacall ()
   from /usr/lib/kde4/lib/libkio.so.5
#37 0xb74fc8ab in QMetaCallEvent::placeMetaCall ()
   from /usr/lib/libQtCore.so.4
#38 0xb74fdc31 in QObject::event () from /usr/lib/libQtCore.so.4
#39 0xb69d0f9c in QApplicationPrivate::notify_helper ()
   from /usr/lib/libQtGui.so.4
#40 0xb69d5bf9 in QApplication::notify () from /usr/lib/libQtGui.so.4
#41 0xb796c1c3 in KApplication::notify () from /usr/lib/kde4/lib/libkdeui.so.5
#42 0xb74ee0b9 in QCoreApplication::notifyInternal ()
   from /usr/lib/libQtCore.so.4
#43 0xb74ef469 in QCoreApplicationPrivate::sendPostedEvents ()
   from /usr/lib/libQtCore.so.4
#44 0xb74ef68d in QCoreApplication::sendPostedEvents ()
   from /usr/lib/libQtCore.so.4
#45 0xb751962f in ?? () from /usr/lib/libQtCore.so.4
#46 0xb6452dd6 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#47 0xb6456193 in ?? () from /usr/lib/libglib-2.0.so.0
#48 0xb645674e in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#49 0xb75199f8 in QEventDispatcherGlib::processEvents ()
   from /usr/lib/libQtCore.so.4
#50 0xb6a64a25 in ?? () from /usr/lib/libQtGui.so.4
#51 0xb74ed33d in QEventLoop::processEvents () from /usr/lib/libQtCore.so.4
#52 0xb74ed4cd in QEventLoop::exec () from /usr/lib/libQtCore.so.4
#53 0xb74ef74d in QCoreApplication::exec () from /usr/lib/libQtCore.so.4
#54 0xb69d0897 in QApplication::exec () from /usr/lib/libQtGui.so.4
#55 0xb7fa682d in kdemain () from /usr/lib/kde4/lib/libkdeinit4_konqueror.so
#56 0x08048582 in _start ()
#0  0xb7fc0410 in __kernel_vsyscall ()
Comment 1 Frank Reininghaus 2008-09-15 21:51:11 UTC
Thanks for the bug report. I can confirm this in 4.1.1 and trunk rev. 861285. It seems to crash for any string that contains a '#' and a letter for me. The failed assertion 

ASSERT: "result.second" in file /home/kde-devel/kde/src/KDE/kdelibs/kio/kio/kdirmodel.cpp, line 308

is reported. This looks just like the thing I found a while ago in http://bugs.kde.org/show_bug.cgi?id=104585#c10.
Comment 2 Frank Reininghaus 2008-09-15 22:16:45 UTC
Actually, this seems to be related to quite a lot of bugs. These all look like duplicates to me: Bug 160057, bug 160070, bug 167349, bug 169436, bug 170317, bug 170695. But maybe I'm wrong and there's a reason why nobody has marked them yet?
Comment 3 Frank Reininghaus 2008-09-16 19:33:11 UTC
The backtrace I get for bug 160057 is really identical, I'm marking this as a duplicate.

*** This bug has been marked as a duplicate of bug 160057 ***
Comment 4 Frank Reininghaus 2008-09-26 22:13:23 UTC
I'm reopening this because it's actually not a duplicate. This needs to be fixed separately for each kioslave (see David's comment in the other bug report). Sorry about the confusion!
Comment 5 David Faure 2008-09-26 23:07:20 UTC
This patches fixes it, but is only valid if no kioslave ever cares for query (?foo) or ref (#ref) in its listDir implementation. In general that's the case... well, kio_imap uses the query in listDir, but that's for special usage by kmail, not in konqueror I think.
Otherwise we need to fix every slave to do a redirect to the url without query nor ref, but this sounds like a lot of trouble for a corner case.

--- kdirlister.cpp      (revision 865118)
+++ kdirlister.cpp      (working copy)
@@ -100,6 +100,8 @@ bool KDirListerCache::listDir( KDirListe
   // like this we don't have to worry about trailing slashes any further
   KUrl _url(_u);
   _url.cleanPath(); // kill consecutive slashes
+  _url.setQuery(QString()); // kill query
+  _url.setRef(QString()); // kill ref (#171117)
   _url.adjustPath(KUrl::RemoveTrailingSlash);
   const QString urlStr = _url.url();
Comment 6 David Faure 2008-09-29 20:31:54 UTC
That was a bad patch, some ioslaves care about the query, like svn:// (bug 169436). Fixed better now.
Trunk r865989+865992, branch r865995.