Bug 317827 - Dolphin crashes on filtering
Summary: Dolphin crashes on filtering
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: bars: filter (show other bugs)
Version: 16.12.2
Platform: Other Linux
: NOR crash
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords: reproducible
Depends on:
Blocks:
 
Reported: 2013-04-04 14:42 UTC by Alex Fiestas
Modified: 2013-07-04 21:40 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 4.11.0


Attachments
Content of the folder that produces the crash (1.23 KB, application/x-compressed-tar)
2013-04-05 16:00 UTC, Alex Fiestas
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Fiestas 2013-04-04 14:42:57 UTC
When filtering a folder Dolphin will crash if, and only if I try to filter from the begining of the word.

Example:

aaaaab.txt
aaaaac.txt
aaaaad.txt
aaaaae.txt
aaaaaf.txt
bbbbx.txt

I filter with "aaa" since I want to get only the aaaa* files, then dolphin crashes.

If I filter by txt, it does not.

Reproducible: Always




#0  0x00007ffff18b61c9 in raise () from /usr/lib/libc.so.6
#1  0x00007ffff18b75c8 in abort () from /usr/lib/libc.so.6
#2  0x00007ffff2959da4 in qt_message_output(QtMsgType, char const*) () from /usr/lib/libQtCore.so.4
#3  0x00007ffff2959f58 in ?? () from /usr/lib/libQtCore.so.4
#4  0x00007ffff295a0e4 in qFatal(char const*, ...) () from /usr/lib/libQtCore.so.4
#5  0x00007ffff785bdca in KItemListView::slotItemsRemoved (this=0x947440, itemRanges=...)
    at /home/afiestas/kde/source/kde-baseapps/dolphin/src/kitemviews/kitemlistview.cpp:1145
#6  0x00007ffff7825ecb in KFileItemListView::slotItemsRemoved (this=0x947440, itemRanges=...)
    at /home/afiestas/kde/source/kde-baseapps/dolphin/src/kitemviews/kfileitemlistview.cpp:295
#7  0x00007ffff782674d in KFileItemListView::qt_static_metacall (_o=0x947440, _c=QMetaObject::InvokeMetaMethod, _id=0, _a=0x7fffffffb3d0)
    at /home/afiestas/kde/build/kde-baseapps/dolphin/src/kfileitemlistview.moc:59
#8  0x00007ffff2a8673f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#9  0x00007ffff786dad1 in KItemModelBase::itemsRemoved (this=0x946530, _t1=...)
    at /home/afiestas/kde/build/kde-baseapps/dolphin/src/kitemmodelbase.moc:126
#10 0x00007ffff782df12 in KFileItemModel::removeItems (this=0x946530, items=..., behavior=KFileItemModel::KeepItemData)
    at /home/afiestas/kde/source/kde-baseapps/dolphin/src/kitemviews/kfileitemmodel.cpp:1129
#11 0x00007ffff782bca6 in KFileItemModel::applyFilters (this=0x946530)
    at /home/afiestas/kde/source/kde-baseapps/dolphin/src/kitemviews/kfileitemmodel.cpp:564
#12 0x00007ffff782b9c2 in KFileItemModel::setNameFilter (this=0x946530, nameFilter=...)
    at /home/afiestas/kde/source/kde-baseapps/dolphin/src/kitemviews/kfileitemmodel.cpp:522
#13 0x00007ffff7894643 in DolphinView::setNameFilter (this=0x945d50, nameFilter=...)
    at /home/afiestas/kde/source/kde-baseapps/dolphin/src/views/dolphinview.cpp:512
#14 0x00007ffff7b58609 in DolphinViewContainer::setNameFilter (this=0x82cfa0, nameFilter=...)
    at /home/afiestas/kde/source/kde-baseapps/dolphin/src/dolphinviewcontainer.cpp:546
#15 0x00007ffff7b59394 in DolphinViewContainer::qt_static_metacall (_o=0x82cfa0, _c=QMetaObject::InvokeMetaMethod, _id=16, _a=
    0x7fffffffb800) at /home/afiestas/kde/build/kde-baseapps/dolphin/src/dolphinviewcontainer.moc:123
#16 0x00007ffff2a8673f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#17 0x00007ffff7b5efa7 in FilterBar::filterChanged (this=0xa11370, _t1=...)
    at /home/afiestas/kde/build/kde-baseapps/dolphin/src/filterbar.moc:107
#18 0x00007ffff7b5ee38 in FilterBar::qt_static_metacall (_o=0xa11370, _c=QMetaObject::InvokeMetaMethod, _id=0, _a=0x7fffffffb980)
    at /home/afiestas/kde/build/kde-baseapps/dolphin/src/filterbar.moc:55
#19 0x00007ffff2a8673f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#20 0x00007ffff41092f2 in QLineEdit::textChanged(QString const&) () from /usr/lib/libQtGui.so.4
#21 0x00007ffff410973f in ?? () from /usr/lib/libQtGui.so.4
#22 0x00007ffff2a8673f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#23 0x00007ffff43a8835 in QLineControl::textChanged(QString const&) () from /usr/lib/libQtGui.so.4
#24 0x00007ffff410ec93 in QLineControl::finishChange(int, bool, bool) () from /usr/lib/libQtGui.so.4
#25 0x00007ffff411128e in QLineControl::processKeyEvent(QKeyEvent*) () from /usr/lib/libQtGui.so.4
---Type <return> to continue, or q <return> to quit---
#26 0x00007ffff41051b9 in QLineEdit::keyPressEvent(QKeyEvent*) () from /usr/lib/libQtGui.so.4                                                                                                                                                                                  
#27 0x00007ffff4bb3f29 in KLineEdit::keyPressEvent (this=0xa1e200, e=0x7fffffffc8f0)                                                                                                                                                                                           
    at /home/afiestas/kde/source/kdelibs/kdeui/widgets/klineedit.cpp:964                                                                                                                                                                                                       
#28 0x00007ffff3cfb90d in QWidget::event(QEvent*) () from /usr/lib/libQtGui.so.4                                                                                                                                                                                               
#29 0x00007ffff4107867 in QLineEdit::event(QEvent*) () from /usr/lib/libQtGui.so.4                                                                                                                                                                                             
#30 0x00007ffff4bb6124 in KLineEdit::event (this=0xa1e200, ev=0x7fffffffc8f0)                                                                                                                                                                                                  
    at /home/afiestas/kde/source/kdelibs/kdeui/widgets/klineedit.cpp:1397                                                                                                                                                                                                      
#31 0x00007ffff3ca3801 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4                                                                                                                                                                 
#32 0x00007ffff3ca94c4 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4                                                                                                                                                                               
#33 0x00007ffff4accd12 in KApplication::notify (this=0x7fffffffd750, receiver=0xa1e200, event=0x7fffffffc8f0)                                                                                                                                                                  
    at /home/afiestas/kde/source/kdelibs/kdeui/kernel/kapplication.cpp:311                                                                                                                                                                                                     
#34 0x00007ffff2a6f09e in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4                                                                                                                                                                  
#35 0x00007ffff3d4d93a in ?? () from /usr/lib/libQtGui.so.4                                                                                                                                                                                                                    
#36 0x00007ffff3d4dd71 in ?? () from /usr/lib/libQtGui.so.4                                                                                                                                                                                                                    
#37 0x00007ffff3d29e28 in QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib/libQtGui.so.4                                                                                                                                                                               
#38 0x00007ffff3d51be2 in ?? () from /usr/lib/libQtGui.so.4                                                                                                                                                                                                                    
#39 0x00007fffecac2845 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0                                                                                                                                                                                            
#40 0x00007fffecac2b78 in ?? () from /usr/lib/libglib-2.0.so.0                                                                                                                                                                                                                 
#41 0x00007fffecac2c34 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0                                                                                                                                                                                           
#42 0x00007ffff2aa0aa6 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4                                                                                                                                           
#43 0x00007ffff3d5184e in ?? () from /usr/lib/libQtGui.so.4                                                                                                                                                                                                                    
#44 0x00007ffff2a6d53f in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4                                                                                                                                                     
#45 0x00007ffff2a6d798 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4                                                                                                                                                              
#46 0x00007ffff2a72e58 in QCoreApplication::exec() () from /usr/lib/libQtCore.so.4                                                                                                                                                                                             
#47 0x00007ffff7b5fd91 in kdemain (argc=1, argv=0x7fffffffdcf8) at /home/afiestas/kde/source/kde-baseapps/dolphin/src/main.cpp:93                                                                                                                                              
#48 0x0000000000400982 in main (argc=1, argv=0x7fffffffdcf8) at /home/afiestas/kde/build/kde-baseapps/dolphin/src/dolphin_dummy.cpp:3
Comment 1 Frank Reininghaus 2013-04-04 15:01:43 UTC
Thanks for the report, but I cannot reproduce. Are these really the only files in the directory? If I look at the code, it seems to me that the assert can only be hit if the items that are removed by the filter are not in one contiguous range, and I think that this isn't the case when using 'aaa' as the filter for these files because only one file (bbbbx.txt) is removed.
Comment 2 Alex Fiestas 2013-04-05 16:00:52 UTC
Created attachment 78659 [details]
Content of the folder that produces the crash
Comment 3 Alex Fiestas 2013-04-05 16:01:15 UTC
With the content in that folder, filtering by "run" will produce the crash.
Comment 4 Aleix Pol 2013-04-05 16:02:58 UTC
I get that problem too, with the files uploaded by Alex.
Comment 5 Martin Klapetek 2013-04-05 16:07:51 UTC
I can't reproduce on 4.10.1 (Dolphin 2.2) with Qt 4.8.4 (Kubuntu 13.04).
Comment 6 Frank Reininghaus 2013-04-08 11:47:37 UTC
Thanks, I can reproduce the crash with the files from comment 2 both in master and 4.10, but

a) only in Icons and Compact view, and
b) only if typing the first two letters of 'run' rather fast.

I haven't written the code in KItemListView, and I'm not exactly sure what the point of the assert is. I hope we can figure out how to fix this. At least it should hopefully not affect distro packages because the assert is removed if QT_NO_DEBUG is defined.
Comment 7 Frank Reininghaus 2013-04-22 19:36:44 UTC
I haven't found the time yet to figure out if the assert is wrong or if there is a latent bug somewhere. For the time being, I think it's better to replace the assert with a TODO comment to prevent that users suffer from this issue.
Comment 8 Frank Reininghaus 2013-04-22 19:39:14 UTC
Git commit 34d0ad722e48819f7d338094fd5a0c56debf01bb by Frank Reininghaus.
Committed on 22/04/2013 at 21:36.
Pushed by freininghaus into branch 'KDE/4.10'.

Comment out assertion to fix a crash when filtering in Icons/Compat View

I'm not sure yet if there is a problem somewhere else in the code. For
the time being, I think it's better to replace the assert by a TODO
comment to prevent that users find out the hard way that there is
something that we're not quite sure about.
FIXED-IN: 4.10.3

M  +4    -1    dolphin/src/kitemviews/kitemlistview.cpp

http://commits.kde.org/kde-baseapps/34d0ad722e48819f7d338094fd5a0c56debf01bb
Comment 9 Frank Reininghaus 2013-07-04 21:40:13 UTC
Git commit 36e28db3f3d90acbe2c2eb92f0569f5fe2f3b06e by Frank Reininghaus.
Committed on 04/07/2013 at 21:35.
Pushed by freininghaus into branch 'master'.

Make sure that KItemListSizeHintResolver is always consistent

This was the root cause of bug 317827. The assert tried to make sure
that we never access KItemListSizeHintResolver from
KItemListViewLayouter inside the loop over the item ranges. This would
be dangerous because it might be in an inconsistent state - the removed
item ranges were removed step by step, so accessing the item size hints
before the operation was finished could lead to wrong results.

The solution is to insert/remove all item ranges immediately. A nice
side effect is that there are no sources of O(N^2) complexity in
KItemListSizeHintResolver any more if many item ranges are
inserted/removed.
FIXED-IN: 4.11.0
REVIEW: 111382

M  +6    -22   dolphin/src/kitemviews/kitemlistview.cpp
M  +65   -11   dolphin/src/kitemviews/private/kitemlistsizehintresolver.cpp
M  +3    -3    dolphin/src/kitemviews/private/kitemlistsizehintresolver.h

http://commits.kde.org/kde-baseapps/36e28db3f3d90acbe2c2eb92f0569f5fe2f3b06e