Bug 211525 - [Fixed in KDESC 4.3.5 and 4.4.x] Dolphin crashes when unmounting/disconnecting a partition/drive [KUrl, KFileItem::url, ..., KFilePreviewGenerator::Private::orderItems]
Summary: [Fixed in KDESC 4.3.5 and 4.4.x] Dolphin crashes when unmounting/disconnectin...
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 16.12.2
Platform: Unlisted Binaries Linux
: NOR crash
Target Milestone: ---
Assignee: Peter Penz
URL:
Keywords:
: 211988 213085 213166 213231 214285 214941 214946 215188 215550 216444 216524 216943 217127 217269 217712 217857 218345 218969 219608 219904 220169 220249 220835 222307 222577 223239 223549 223551 224061 224669 225102 225335 227860 228484 229773 230980 231228 231349 232074 234472 234493 235482 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-10-23 11:58 UTC by Leo
Modified: 2010-08-06 20:10 UTC (History)
20 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Suggested patch (2.28 KB, patch)
2009-11-26 00:48 UTC, Frank Reininghaus
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Leo 2009-10-23 11:58:52 UTC
Application that crashed: dolphin
Version of the application: 1.3
KDE Version: 4.3.2 (KDE 4.3.2)
Qt Version: 4.5.2
Operating System: Linux 2.6.28-16-generic x86_64
Distribution: Ubuntu 9.04

 -- Backtrace:
Application: Dolphin (dolphin), signal: Segmentation fault
[KCrash Handler]
#5  QUrl (this=0x7fffad672a60, other=@0x10) at io/qurl.cpp:3936
#6  0x00007f8a25d72ef9 in KUrl (this=0x7fffad672a60, _u=@0x10) at /build/buildd/kde4libs-4.3.2/kdecore/io/kurl.cpp:468
#7  0x00007f8a28394470 in KFileItem::url (this=<value optimized out>) at /build/buildd/kde4libs-4.3.2/kio/kio/kfileitem.cpp:1271
#8  0x00007f8a28384b14 in KDirModel::indexForItem (this=0x13490a0, item=@0x1754b60) at /build/buildd/kde4libs-4.3.2/kio/kio/kdirmodel.cpp:919
#9  0x00007f8a2803719a in KFilePreviewGenerator::Private::orderItems (this=0x13ce9e0, items=@0x7fffad672bc0) at /build/buildd/kde4libs-4.3.2/kfile/kfilepreviewgenerator.cpp:1023
#10 0x00007f8a2803ace1 in KFilePreviewGenerator::Private::updateIcons (this=0x13ce9e0, items=@0x7fffad672c30) at /build/buildd/kde4libs-4.3.2/kfile/kfilepreviewgenerator.cpp:508
#11 0x00007f8a2803af49 in KFilePreviewGenerator::Private::delayedIconUpdate (this=0x13ce9e0) at /build/buildd/kde4libs-4.3.2/kfile/kfilepreviewgenerator.cpp:1088
#12 0x00007f8a2803c072 in KFilePreviewGenerator::qt_metacall (this=0x13ce7e0, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x7fffad672d20)
    at /build/buildd/kde4libs-4.3.2/obj-x86_64-linux-gnu/kfile/kfilepreviewgenerator.moc:95
#13 0x00007f8a24b63ea2 in QMetaObject::activate (sender=0x13ce9b0, from_signal_index=<value optimized out>, to_signal_index=4, argv=0x220) at kernel/qobject.cpp:3113
#14 0x00007f8a24b5e263 in QObject::event (this=0x13ce9b0, e=0x10) at kernel/qobject.cpp:1075
#15 0x00007f8a24fe3f4d in QApplicationPrivate::notify_helper (this=0xf8e930, receiver=0x13ce9b0, e=0x7fffad6733d0) at kernel/qapplication.cpp:4056
#16 0x00007f8a24fec18a in QApplication::notify (this=0x7fffad673710, receiver=0x13ce9b0, e=0x7fffad6733d0) at kernel/qapplication.cpp:4021
#17 0x00007f8a2656eabb in KApplication::notify (this=0x7fffad673710, receiver=0x13ce9b0, event=0x7fffad6733d0) at /build/buildd/kde4libs-4.3.2/kdeui/kernel/kapplication.cpp:302
#18 0x00007f8a24b4e6ac in QCoreApplication::notifyInternal (this=0x7fffad673710, receiver=0x13ce9b0, event=0x7fffad6733d0) at kernel/qcoreapplication.cpp:610
#19 0x00007f8a24b7b516 in QTimerInfoList::activateTimers (this=0xf93e60) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:213
#20 0x00007f8a24b77b2d in timerSourceDispatch (source=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:165
#21 0x00007f8a201cd20a in IA__g_main_context_dispatch (context=0xf92d20) at /build/buildd/glib2.0-2.20.1/glib/gmain.c:1814
#22 0x00007f8a201d08e0 in g_main_context_iterate (context=0xf92d20, block=1, dispatch=1, self=<value optimized out>) at /build/buildd/glib2.0-2.20.1/glib/gmain.c:2448
#23 0x00007f8a201d0a7c in IA__g_main_context_iteration (context=0xf92d20, may_block=1) at /build/buildd/glib2.0-2.20.1/glib/gmain.c:2511
#24 0x00007f8a24b77a8f in QEventDispatcherGlib::processEvents (this=0xf63b50, flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:327
#25 0x00007f8a2507cbdf in QGuiEventDispatcherGlib::processEvents (this=0x7fffad672a60, flags=<value optimized out>) at kernel/qguieventdispatcher_glib.cpp:202
#26 0x00007f8a24b4cf42 in QEventLoop::processEvents (this=<value optimized out>, flags={i = -1385744832}) at kernel/qeventloop.cpp:149
#27 0x00007f8a24b4d314 in QEventLoop::exec (this=0x7fffad673680, flags={i = -1385744752}) at kernel/qeventloop.cpp:201
#28 0x00007f8a24b4f5e4 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:888
#29 0x00000000004397cd in _start ()

Reported using DrKonqi
Comment 1 Dario Andres 2009-10-23 14:28:30 UTC
Mh, it looks like a new case of bug 200125 on 4.3.2 :-\
Thanks
Comment 2 Frank Reininghaus 2009-10-25 12:39:47 UTC
(In reply to comment #1)
> Mh, it looks like a new case of bug 200125 on 4.3.2 :-\

Mh, yes, it does :-( I suppose you copied or moved the archive to the current folder just before you tried to open it? Can you reproduce this crash?

Thanks!
Comment 3 Dario Andres 2009-11-04 16:11:42 UTC
*** Bug 211988 has been marked as a duplicate of this bug. ***
Comment 4 Dario Andres 2009-11-04 16:11:49 UTC
*** Bug 213085 has been marked as a duplicate of this bug. ***
Comment 5 Dario Andres 2009-11-05 15:14:55 UTC
From bug 213231:
What I was doing when the application crashed:
- 2 dolphin windows open.
- copied large file (600mb) to usb-stick.
- immediately after file-copy complete i 'safely removed'/unmounted the
usb-stick via the default plasma-widget in the taskbar.
=> dolphin crashes.
Comment 6 Dario Andres 2009-11-05 15:14:56 UTC
*** Bug 213231 has been marked as a duplicate of this bug. ***
Comment 7 Dario Andres 2009-11-05 15:14:56 UTC
*** Bug 213166 has been marked as a duplicate of this bug. ***
Comment 8 Frank Reininghaus 2009-11-12 18:29:13 UTC
*** Bug 214285 has been marked as a duplicate of this bug. ***
Comment 9 Frank Reininghaus 2009-11-17 11:37:29 UTC
*** Bug 214941 has been marked as a duplicate of this bug. ***
Comment 10 Frank Reininghaus 2009-11-17 11:37:35 UTC
*** Bug 214946 has been marked as a duplicate of this bug. ***
Comment 11 Frank Reininghaus 2009-11-17 12:49:15 UTC
@Peter: most crashes here occurred after unmounting a USB drive. It seems that KFilePreviewGenerator::Private::killPreviewJobs() / KFilePreviewGenerator::cancelPreviews() is not called in this case? I haven't checked yet if that can be done easily.

One could also fix this by checking if each file item is valid in KFilePreviewGenerator::Private::orderItems(KFileItemList& items) before calling KDirModel::indexForItem(...) and removing it from the list if that is not the case - maybe that should be done for safety in any case because you never know if a file gets deleted by an external application...
Comment 12 Dario Andres 2009-11-19 01:52:04 UTC
*** Bug 215188 has been marked as a duplicate of this bug. ***
Comment 13 Dario Andres 2009-11-21 14:16:05 UTC
*** Bug 215550 has been marked as a duplicate of this bug. ***
Comment 14 Frank Reininghaus 2009-11-26 00:48:54 UTC
Created attachment 38591 [details]
Suggested patch

Maybe one could fix it like this - if model indexes are removed from the dir model, also remove their URLs (and the URLs of all children) from m_changedItems. Unfortunately, I can't really test it because some quick attempts to reproduce the crash failed.

@Peter: Does this make sense to you?
Comment 15 Peter Penz 2009-11-27 08:11:15 UTC
@Frank: Thanks for the patch. Yes: this makes sense. BTW: I additionally added the isValid() check in orderItems() a few weeks ago on trunk. Please commit the patch, so that we have the chance to get feedback after beta2 :-)
Comment 16 Frank Reininghaus 2009-11-28 01:56:22 UTC
*** Bug 216444 has been marked as a duplicate of this bug. ***
Comment 17 Frank Reininghaus 2009-11-28 18:06:11 UTC
SVN commit 1055748 by freininghaus:

If items are removed from the dir model, remove them also from
KFilePreviewGenerator's list of recently changed items. This should
fix crashes that occur when a file item becomes invalid just after it
is changed, e.g., if a large file is moved to a volume which is then
unmounted immediately.

Fix will be in KDE 4.4 Beta 1.

BUG: 211525


 M  +28 -1     kfilepreviewgenerator.cpp  
 M  +1 -0      kfilepreviewgenerator.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1055748
Comment 18 Frank Reininghaus 2009-11-28 18:07:40 UTC
*** Bug 216524 has been marked as a duplicate of this bug. ***
Comment 19 Dario Andres 2009-12-04 00:43:24 UTC
*** Bug 217127 has been marked as a duplicate of this bug. ***
Comment 20 Dario Andres 2009-12-04 00:43:31 UTC
*** Bug 217269 has been marked as a duplicate of this bug. ***
Comment 21 Dario Andres 2009-12-08 13:06:31 UTC
*** Bug 217857 has been marked as a duplicate of this bug. ***
Comment 22 Dario Andres 2009-12-12 23:41:04 UTC
*** Bug 218345 has been marked as a duplicate of this bug. ***
Comment 23 Dario Andres 2009-12-16 23:15:37 UTC
*** Bug 218969 has been marked as a duplicate of this bug. ***
Comment 24 Peter Penz 2009-12-18 11:09:09 UTC
*** Bug 216943 has been marked as a duplicate of this bug. ***
Comment 25 Dario Andres 2009-12-21 23:27:07 UTC
*** Bug 219608 has been marked as a duplicate of this bug. ***
Comment 26 Dario Andres 2009-12-24 20:32:44 UTC
*** Bug 217712 has been marked as a duplicate of this bug. ***
Comment 27 Dario Andres 2009-12-28 18:43:57 UTC
*** Bug 220249 has been marked as a duplicate of this bug. ***
Comment 28 Dario Andres 2009-12-31 15:56:18 UTC
*** Bug 219904 has been marked as a duplicate of this bug. ***
Comment 29 Dario Andres 2009-12-31 22:38:31 UTC
*** Bug 220835 has been marked as a duplicate of this bug. ***
Comment 30 Frank Reininghaus 2010-01-12 18:35:27 UTC
*** Bug 222307 has been marked as a duplicate of this bug. ***
Comment 31 Frank Reininghaus 2010-01-14 11:55:54 UTC
*** Bug 222577 has been marked as a duplicate of this bug. ***
Comment 32 Frank Reininghaus 2010-01-15 21:00:03 UTC
SVN commit 1075313 by freininghaus:

Backport of commit 1055748 to the 4.3 branch:

If items are removed from the dir model, remove them also from
KFilePreviewGenerator's list of recently changed items. This should
fix crashes that occur when a file item becomes invalid just after it
is changed, e.g., if a large file is moved to a volume which is then
unmounted immediately.

Fix will be in KDE 4.3.5.

CCBUG: 211525


 M  +27 -0     kfilepreviewgenerator.cpp  
 M  +1 -0      kfilepreviewgenerator.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1075313
Comment 33 Dario Andres 2010-01-18 12:27:05 UTC
Fixing title, sorry about the noise
Comment 34 Dario Andres 2010-01-18 12:27:33 UTC
*** Bug 223239 has been marked as a duplicate of this bug. ***
Comment 35 Peter Penz 2010-01-20 11:13:28 UTC
*** Bug 223549 has been marked as a duplicate of this bug. ***
Comment 36 Peter Penz 2010-01-20 11:14:07 UTC
*** Bug 223551 has been marked as a duplicate of this bug. ***
Comment 37 Dario Andres 2010-01-24 20:10:19 UTC
*** Bug 224061 has been marked as a duplicate of this bug. ***
Comment 38 Dario Andres 2010-01-28 22:02:26 UTC
*** Bug 224669 has been marked as a duplicate of this bug. ***
Comment 39 Dario Andres 2010-02-01 22:35:36 UTC
*** Bug 225102 has been marked as a duplicate of this bug. ***
Comment 40 Dario Andres 2010-02-03 01:53:59 UTC
*** Bug 225335 has been marked as a duplicate of this bug. ***
Comment 41 Dario Andres 2010-02-20 22:36:11 UTC
*** Bug 227860 has been marked as a duplicate of this bug. ***
Comment 42 Michał Małek 2010-02-20 23:16:42 UTC
*** Bug 220169 has been marked as a duplicate of this bug. ***
Comment 43 Michał Małek 2010-02-25 17:57:26 UTC
*** Bug 228484 has been marked as a duplicate of this bug. ***
Comment 44 Dario Andres 2010-03-12 20:37:54 UTC
*** Bug 229773 has been marked as a duplicate of this bug. ***
Comment 45 Frank Reininghaus 2010-03-16 16:56:51 UTC
*** Bug 230980 has been marked as a duplicate of this bug. ***
Comment 46 Frank Reininghaus 2010-03-18 16:08:51 UTC
*** Bug 231228 has been marked as a duplicate of this bug. ***
Comment 47 Dario Andres 2010-03-19 22:19:54 UTC
*** Bug 231349 has been marked as a duplicate of this bug. ***
Comment 48 Dario Andres 2010-03-25 12:05:33 UTC
*** Bug 232074 has been marked as a duplicate of this bug. ***
Comment 49 Frank Reininghaus 2010-04-15 21:36:24 UTC
*** Bug 234472 has been marked as a duplicate of this bug. ***
Comment 50 Frank Reininghaus 2010-04-16 05:56:10 UTC
*** Bug 234493 has been marked as a duplicate of this bug. ***
Comment 51 Nicolas L. 2010-08-06 20:10:11 UTC
*** Bug 235482 has been marked as a duplicate of this bug. ***