| Summary: | Frequent Crash in ProblemStore::addDiagnostic due to endless recursion | ||
|---|---|---|---|
| Product: | [Applications] kdevelop | Reporter: | David Nolden <david.nolden.kde> |
| Component: | Language Support: CPP (Clang-based) | Assignee: | kdevelop-bugs-null |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | NOR | ||
| Version First Reported In: | git master | ||
| Target Milestone: | --- | ||
| Platform: | Compiled Sources | ||
| OS: | Linux | ||
| Latest Commit: | http://commits.kde.org/kdevplatform/5abba92236eca24126a6863f1eec149693a9c4f9 | Version Fixed/Implemented In: | 5.0.0 |
| Sentry Crash Report: | |||
|
Description
David Nolden
2016-07-01 10:21:03 UTC
Note that I'm currently testing a patch to fix this. Until now it seems to work. I'll commit it if the bug doesn't reappear. The trick is to always re-index the child diagnostics in LocalIndexedProblem::LocalIndexedProblem(...), to ensure that the indices are current. At the moment there is some logic which avoids the re-indexing if the number of diagnostics didn't change, which is probably wrong, because the diagnostics themselves may have changed, even if their count didn't change. Please post to Phabricator if it's a non-trivial patch. I've never seen that issue, fwiw. Git commit 5abba92236eca24126a6863f1eec149693a9c4f9 by David Nolden. Committed on 04/07/2016 at 12:12. Pushed by zwabel into branch '5.0'. Fix possible crash in ProblemStore::addDiagnostic The problem was, that child problem indices weren't updated when the number of child problems didn't change. When that happened, then child problem indices could be wrong and basically random, thus creating a recursive link which would normally be impossible. The solution is, to always re-index the children when storing the problem, no matter whether the child count changed or not. M +6 -9 language/duchain/problem.cpp http://commits.kde.org/kdevplatform/5abba92236eca24126a6863f1eec149693a9c4f9 The patch was actually quite trivial, the conditional "if (static_cast<uint>(problem->m_diagnostics.size()) != problem->d_func()->diagnosticsSize())" simply needed to be removed so that indices are updated. |