Summary: | code folding crash | ||
---|---|---|---|
Product: | [Applications] kate | Reporter: | Joseph Wenninger <jowenn> |
Component: | folding | Assignee: | KWrite Developers <kwrite-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | adrian.lungu89 |
Priority: | VHI | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Debian testing | ||
OS: | Linux | ||
Latest Commit: | http://commits.kde.org/kate/a6007b4f26f95ef8e00381853ce30b6e7177236a | Version Fixed In: | |
Sentry Crash Report: | |||
Attachments: | file to reproduce crash |
Description
Joseph Wenninger
2012-10-27 12:09:33 UTC
Created attachment 74828 [details]
file to reproduce crash
Git commit 5d8e230ac5d925b12538b76af5af0ad7145c3031 by Dominik Haumann. Committed on 27/10/2012 at 17:06. Pushed by dhaumann into branch 'master'. add unit test for bug 309093 run it with: ./run.sh ./kate/build/tests/bug309093_test.shell M +11 -0 part/tests/CMakeLists.txt A +76 -0 part/tests/bug309093.cpp [License: LGPL (v2+)] A +41 -0 part/tests/bug309093.h [License: LGPL (v2+)] A +1066 -0 part/tests/bug309093_example.cpp [License: LGPL (v2+)] http://commits.kde.org/kate/5d8e230ac5d925b12538b76af5af0ad7145c3031 Git commit a6007b4f26f95ef8e00381853ce30b6e7177236a by Joseph Wenninger. Committed on 28/10/2012 at 18:01. Pushed by jowenn into branch 'master'. This should hopefully fix #309093. I think a similar behaviour in wrapLine could also be needed. The the cause of the crash was: 1: if (......) { 2: ......; 3: ......; 4: } else if { .... 5: ..... If the text from infront of the first if to just infront of the second if got deleted a line unwrapping action took place The kate buffer just kept the { of line 1 and removed the information about the } { in line 4 during unwrapping, without triggering a tree update. 1: if { .... 2: ..... When doing highlighting again it found again that the new block had a single { in the new line 1, therefore it triggered a column only update within the folding tree. The tree on the other hand thought that it still had two region changes in the now new line 1 and tried to update all columns as being told by the buffer, but the information it got from the highlighting system containd only one opening region -> access to an elemnt in the vector that was out of bounds -> assert/crash Now unwrapping just joins the region changes of the involved lines and the tree checks if the lenghtes of the vectors matche, so it should always do a complete update of the meta information if needed M +7 -0 part/buffer/katetextblock.cpp M +4 -10 part/document/katebuffer.cpp M +0 -2 part/document/katebuffer.h M +9 -0 part/syntax/katecodefolding.cpp http://commits.kde.org/kate/a6007b4f26f95ef8e00381853ce30b6e7177236a |