Summary: | Crash in problem data serialization | ||
---|---|---|---|
Product: | [Applications] kdevelop | Reporter: | Milian Wolff <mail> |
Component: | general | Assignee: | kdevelop-bugs-null |
Status: | RESOLVED FIXED | ||
Severity: | crash | Keywords: | drkonqi, release_blocker, reproducible |
Priority: | VHI | ||
Version: | 4.6.60 | ||
Target Milestone: | --- | ||
Platform: | Arch Linux | ||
OS: | Linux | ||
Latest Commit: | http://commits.kde.org/kdevplatform/83365b0cb5dbd08839e787b85ebdb5ba7316717e | Version Fixed In: |
Description
Milian Wolff
2014-01-31 00:10:25 UTC
Git commit 254b7f1c78714a4169334eba9ce4d267a0e48b61 by Milian Wolff. Committed on 11/02/2014 at 23:04. Pushed by mwolff into branch 'master'. Add unit test for ProblemSerialization, it will crash as-is. A fix for the crash will follow. M +2 -2 language/duchain/duchain.cpp M +1 -1 language/duchain/duchain.h M +79 -0 language/duchain/tests/test_duchain.cpp M +1 -0 language/duchain/tests/test_duchain.h http://commits.kde.org/kdevplatform/254b7f1c78714a4169334eba9ce4d267a0e48b61 Git commit 83365b0cb5dbd08839e787b85ebdb5ba7316717e by Milian Wolff. Committed on 11/02/2014 at 23:09. Pushed by mwolff into branch 'master'. Fix crashes due to Problem serialization. This is a major refactoring of the initial problem serialization code as introduced by 0c2eb5c70c1. We now add "proper" support for serializing data items which inherit QSharedData in the top context file, i.e. TopDUContextDynamicData. Shared data items are special, as in order to keep the expected invariants we deviate from other items behavior when serializing: 1) When an item is serialized, we do not change the d_ptr of the Item, i.e. the data will still point to the dynamic data and never to the constant serialized data. 2) When deserializing, similar to above, we make the item dynamic instantly such that the Item is not pointing to the constant data. This is required in order to prevent double deletions or crashes due to use-after-free when a shared data pointer outlives the "parent" TopDUContext. When that one is deleted, or saved to disk, we previously deleted items (as we assumed to have ownership), and unmapped the data - thus shared data pointers must never point to the mmapped data regions. While complicated and big, I think this patch is cleaner than my initial implementation. And since the previously added test now passes, I'm confident this is an improvement. Memory is also still cleaned up as before. M +38 -57 language/duchain/problem.cpp M +5 -14 language/duchain/problem.h M +8 -33 language/duchain/topducontext.cpp M +0 -7 language/duchain/topducontext.h M +91 -37 language/duchain/topducontextdynamicdata.cpp M +12 -13 language/duchain/topducontextdynamicdata.h http://commits.kde.org/kdevplatform/83365b0cb5dbd08839e787b85ebdb5ba7316717e |