Summary: | KDevelop crashes when clicking on QuickOpen | ||
---|---|---|---|
Product: | [Applications] kdevelop | Reporter: | Peifeng Yu <pfyu817> |
Component: | general | Assignee: | kdevelop-bugs-null |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | anton, aspotashev |
Priority: | HI | Keywords: | drkonqi, regression, release_blocker |
Version First Reported In: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Arch Linux | ||
OS: | Linux | ||
Latest Commit: | https://commits.kde.org/kdevplatform/0c10cf21ed8879019bec1c5eb277f5f37f2eb1d6 | Version Fixed In: | |
Sentry Crash Report: |
Description
Peifeng Yu
2017-01-11 03:21:21 UTC
Could be related to https://phabricator.kde.org/D3673 -- could you try reverting & testing again? I tried to revert 4f3e1fbbc, but it doesn't apply cleanly. There are still compilation errors after solving a few conflicts. So I built the commit before that (f00f30037), and tested. There's no crash. So I can confirm at least the bug was introduced between 4f3e1fbbc...7fa22b617(HEAD). I did a bisect, seems ed9e1726c8c6c25b601da0893ecff8f9f9f47364 is the first bad commit. Maybe related to the cache of ProjectItemDataProvider::itemCount? Also, sometimes the crash was only triggered when opening a relative big project while background parsing just started running. Could you try to nail down which commit it is? I've looked through ed9e1726c8c6c25b601da0893ecff8f9f9f47364 several times now, I can't see how that one can possibly break anything -- the cached value should never be out of date or non-dirty when itemCount() is called. It's getting weirder. Mainly I tried on three commits (and a few others between ed9e1726c and 7fa22b617, the results were similar). + 2b44ef9f6, the commit right before ed9e1726c. Crash can't be triggered. + ed9e1726c, the first bad commit found by git bisect. I can reproduce the crash somethings + 7fa22b617, current master HEAD. Seems it's easier to trigger the crash than ed9e1726c By now, the most reliable way for me to trigger the crash is to quickly click on the line edit right after that main window shows, before the background parser fully starts. Here's the relevant log for the crash kdevplatform.plugins.quickopen: got focus kdevplatform.plugins.quickopen: old widget QWidget(0x0) force update: false kdevplatform.plugins.quickopen: created the widget create expanding tree kdevplatform.plugins.quickopen: params QSet("Files", "Functions", "Classes", "Documentation", "Actions") QSet("Project", "Currently Open", "Includes") kdevplatform.plugins.quickopen: comparing QSet("Currently Open") QSet("Files") kdevplatform.plugins.quickopen: enabling QSet("Files") QSet("Currently Open") kdevplatform.plugins.quickopen: comparing QSet("Project") QSet("Files") kdevplatform.plugins.quickopen: enabling QSet("Files") QSet("Project") kdevplatform.plugins.quickopen: comparing QSet("Project") QSet("Functions", "Classes") kdevplatform.plugins.quickopen: enabling QSet("Functions", "Classes") QSet("Project") kdevplatform.plugins.quickopen: comparing QSet("Includes") QSet("Documentation") kdevplatform.plugins.quickopen: enabling QSet("Documentation") QSet("Includes") kdevplatform.plugins.quickopen: comparing QSet("Includes") QSet("Actions") kdevplatform.plugins.quickopen: enabling QSet("Actions") QSet("Includes") kdevplatform.plugins.quickopen: activating kdevplatform.plugins.quickopen: eventFilter QChildEvent(ChildAdded, QObject(0x4b25390)) kdevplatform.plugins.quickopen: eventFilter QChildEvent(ChildAdded, QObject(0x4b27650)) kdevplatform.plugins.quickopen: before m_widget->show kdevplatform.plugins.quickopen: eventFilter QEvent(Polish, 0x7ffddd2a19e0) kdevplatform.plugins.quickopen: eventFilter QEvent(Polish, 0x7ffddd2a19e0) kdevplatform.plugins.quickopen: eventFilter QChildEvent(ChildPolished, QWidget(0x37650d0, name = "qt_scrollarea_viewport")) kdevplatform.plugins.quickopen: eventFilter QChildEvent(ChildPolished, QWidget(0x2072410, name = "qt_scrollarea_hcontainer")) kdevplatform.plugins.quickopen: eventFilter QChildEvent(ChildPolished, QWidget(0x240e860, name = "qt_scrollarea_vcontainer")) kdevplatform.plugins.quickopen: eventFilter QChildEvent(ChildPolished, QHeaderView(0x49f7ad0)) kdevplatform.plugins.quickopen: eventFilter QMoveEvent(2,2, non-spontaneous) kdevplatform.plugins.quickopen: eventFilter QResizeEvent(696, 323, non-spontaneous) KCrash: Application 'kdevelop' crashing... (In reply to Aetf from comment #5) > + ed9e1726c, the first bad commit found by git bisect. I can reproduce the > crash somethings s/somethings/sometimes I added some debug log to the itemCount cachedResult method, but the crash happens even before that get called. Looking at the code, in QuickOpenLineEdit::focusInEvent in quickopenplugin.cpp, and only after the QuickOpenWidget is created for the first time, and is set to shown (crash at this line quickopenplugin.cpp:1055). I run out of idea what to looking at next... The crash is happens if in the "Items" list we select "Functions" and/or "Classes". If such items are disabled I can't reproduce this annoying crashes. It seems the problem is in model class or/and in DUChain backend, which provide functions/classes information. Git commit 0c10cf21ed8879019bec1c5eb277f5f37f2eb1d6 by Anton Anikin. Committed on 14/02/2017 at 08:17. Pushed by antonanikin into branch 'master'. Fix BUG 374894 - KDevelop crashes when clicking on QuickOpen Summary: The problem was in uninitialized value returned by `ResultCache::cachedResult()` which is called from `ProjectItemDataProvider::itemCount()` and `ProjectItemDataProvider::unfilteredItemCount()` methods. The crash happens only if uninitialized value is sufficiently big and `ResultCache::markDirty()` was not called before. Test Plan: Tested on master branch Reviewers: #kdevelop, kfunk Reviewed By: #kdevelop, kfunk Subscribers: brauch, kdevelop-devel Differential Revision: https://phabricator.kde.org/D4598 M +1 -1 plugins/quickopen/projectitemquickopen.h https://commits.kde.org/kdevplatform/0c10cf21ed8879019bec1c5eb277f5f37f2eb1d6 |