Summary: | Dolphin crashes when pasting files | ||
---|---|---|---|
Product: | [Applications] dolphin | Reporter: | Sandro Mani <manisandro> |
Component: | general | Assignee: | Dolphin Bug Assignee <dolphin-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | auxsvr, hrvoje.senjan, kde, mathieu.tarral, miras199002, william.linna |
Priority: | NOR | Keywords: | regression |
Version: | 2.1.85 | ||
Target Milestone: | --- | ||
Platform: | Fedora RPMs | ||
OS: | Linux | ||
Latest Commit: | http://commits.kde.org/kde-baseapps/6d0f9ada0198f6e73a8fca1e709676d0ac83a67b | Version Fixed In: | 4.9.5 |
Sentry Crash Report: | |||
Attachments: |
Archive containing the folder and file which cause the crash when pasted
Proposed fix |
Description
Sandro Mani
2012-12-06 10:06:34 UTC
Created attachment 75652 [details]
Archive containing the folder and file which cause the crash when pasted
*** Bug 311254 has been marked as a duplicate of this bug. *** Thanks for the bug report! The line where it crashes in DolphinView::updateViewState() is 'const int index = m_model->index(*it)' in the block for (QList<KUrl>::iterator it = m_selectedUrls.begin(); it != m_selectedUrls.end(); ++it) { const int index = m_model->index(*it); if (index >= 0) { selectedItems.insert(index); m_selectedUrls.erase(it); } } That looks indeed fishy - we erase an iterator from the list and then increment it. If the iterator pointed to the last list element before that, it now points out of the list :-( Created attachment 75658 [details]
Proposed fix
This fixes it for me. Selecting pasted and dropped items still works fine. It would be nice if you could test it and confirm that it works and fixes the crash or report any problems caused by this patch.
What I really do not understand is why I never saw this crash before. I did test pasting and drag&drop a lot, actually. Maybe I was always lucky and the data that the invalid iterator pointed to still contained what was once a valid KUrl, so it always worked by chance.
Works great - Many thanks! Git commit 6d0f9ada0198f6e73a8fca1e709676d0ac83a67b by Frank Reininghaus. Committed on 06/12/2012 at 19:43. Pushed by freininghaus into branch 'KDE/4.9'. Fix incorrect usage of list iterators The problem was that we erased an iterator from the list and then incremented it. This can lead to problems (namely, random crashes) if the iterator pointed to the last list element. Thanks to Sandro Mani for testing the patch! FIXED-IN: 4.9.5 M +5 -2 dolphin/src/views/dolphinview.cpp http://commits.kde.org/kde-baseapps/6d0f9ada0198f6e73a8fca1e709676d0ac83a67b Frank, is 4.9 merged to master? I'm still getting this with trunk. (In reply to comment #7) > Frank, is 4.9 merged to master? I'm still getting this with trunk. I cannot reproduce in current master. I've merged the 4.9 branch last night: https://projects.kde.org/projects/kde/kde-baseapps/repository/revisions/608dd2329cc567e6e4499aaef4ecf53e2ad15ea1 Which revision do you use? If it's the one I linked to above or a later one, I'd like to see the backtrace (unless it's the same as in comment 0, but I think that this is unlikely). OK, i have it from yesterday afternoon, will rebuild, and if it's still here gonna let you know :-) *** Bug 311428 has been marked as a duplicate of this bug. *** *** Bug 311774 has been marked as a duplicate of this bug. *** *** Bug 311809 has been marked as a duplicate of this bug. *** *** Bug 311908 has been marked as a duplicate of this bug. *** |