Bug 294005 - Infinite loop in KSelectionProxyModel's _getRootListRow()
Summary: Infinite loop in KSelectionProxyModel's _getRootListRow()
Status: CONFIRMED
Alias: None
Product: kdelibs
Classification: Frameworks and Libraries
Component: kdeui (show other bugs)
Version: Git
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Stephen Kelly
URL: http://projects.kde.org/projects/kde/...
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-13 17:04 UTC by Christopher Yeleighton
Modified: 2016-12-16 09:21 UTC (History)
4 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 Christopher Yeleighton 2012-02-13 17:04:30 UTC
while (nextParent == commonParent) {
        if (ansList.size() < bestParentRow + 1)
            // If the list is longer, it means that at the end of it is a descendant of the new index.
            // We insert the ancestors items first in that case.
            break;

        const QModelIndex nextSibling = ansList.value(bestParentRow + 1);

        if (!nextSibling.isValid()) {
            continue;
        }

I ran into this when I added a fourth mail repository to KMail.  The code loops from line 185 to line 194; nothing in between affects the condition of line 185.  In effect, KMail hangs on startup and I am unable to access its preferences.
Comment 1 Christopher Yeleighton 2012-02-13 17:31:49 UTC
The backtrace is in Bug 289476
Comment 2 Christian Mollekopf 2014-03-18 10:04:48 UTC
If nextSibling is ever invalid, this indeed results in an endless loop. I'm not sure how to fix it though.