Bug 294750 - folding crash in python docstring
Summary: folding crash in python docstring
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: folding (show other bugs)
Version: SVN
Platform: Compiled Sources Linux
: VHI crash
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
: 281181 291150 294666 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-02-24 15:04 UTC by Dominik Haumann
Modified: 2012-03-22 22:19 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Python file for reproducing the crash (184 bytes, application/octet-stream)
2012-02-24 15:04 UTC, Dominik Haumann
Details
valgrind trace (175.89 KB, text/plain)
2012-02-24 15:18 UTC, Dominik Haumann
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dominik Haumann 2012-02-24 15:04:24 UTC
Created attachment 69060 [details]
Python file for reproducing the crash

Version:           SVN (using KDE 4.8.0) 
OS:                Linux

Code folding crashes in python docstring.

Reproducible: Always

Steps to Reproduce:
Open the attached python and enable python highlighting.

1. fold all with CTRL+SHIFT+-
2. unfold line 4
3. goto end of line 7
4. hit BACKSPACE -> crash


Expected Results:  
It should not crash.
Comment 1 Dominik Haumann 2012-02-24 15:06:22 UTC
Thread 1 (Thread 0xb5057710 (LWP 30965)):
[KCrash Handler]
#7  0xb5a6e17e in malloc_consolidate () from /lib/libc.so.6
#8  0xb5a6f743 in _int_malloc () from /lib/libc.so.6
#9  0xb5a7259a in malloc () from /lib/libc.so.6
#10 0xb67dcc1d in QTextEngine::LayoutData::reallocate(int) () from /usr/lib/libQtGui.so.4
#11 0xb67e3002 in QTextEngine::attributes() const () from /usr/lib/libQtGui.so.4
#12 0xb67e9cd4 in QTextLine::layout_helper(int) () from /usr/lib/libQtGui.so.4
#13 0xb67ebec3 in QTextLine::setLineWidth(double) () from /usr/lib/libQtGui.so.4
#14 0xb24f6536 in KateRenderer::layoutLine (this=0x829dbb0, lineLayout=..., maxwidth=715, cacheLayout=true) at kate/part/render/katerenderer.cpp:896
#15 0xb24fb19a in KateLayoutCache::line (this=0x829f780, realLine=15, virtualLine=-1) at kate/part/render/katelayoutcache.cpp:318
#16 0xb24fb59f in KateLayoutCache::viewLine (this=0x829f780, realCursor=...) at kate/part/render/katelayoutcache.cpp:389
#17 0xb2554959 in KateViewInternal::viewLineOffset (this=0x82a2390, virtualCursor=..., offset=-32, keepX=false) at kate/part/view/kateviewinternal.cpp:1291
#18 0xb2550dab in KateViewInternal::maxStartPos (this=0x82a2390, changed=false) at kate/part/view/kateviewinternal.cpp:421
#19 0xb2552024 in KateViewInternal::slotRegionVisibilityChanged (this=0x82a2390) at kate/part/view/kateviewinternal.cpp:666
#20 0xb254f25b in KateViewInternal::qt_metacall (this=0x82a2390, _c=QMetaObject::InvokeMetaMethod, _id=16, _a=0xbfd592fc) at kate/build/part/kateviewinternal.moc:130
#21 0xb5fe38ad in QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) () from /usr/lib/libQtCore.so.4
#22 0xb5ff3a0c in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#23 0xb2440605 in KateCodeFoldingTree::regionVisibilityChanged (this=0x829a458) at kate/build/part/moc_katecodefolding.cpp:121
#24 0xb2535856 in KateCodeFoldingTree::unfoldNode (this=0x829a458, node=0x84ac828) at kate/part/syntax/katecodefolding.cpp:1408
#25 0xb2532aa2 in KateCodeFoldingTree::deleteNodeFromMap (this=0x829a458, node=0x84ac828) at kate/part/syntax/katecodefolding.cpp:600
#26 0xb2532b3f in KateCodeFoldingTree::deleteStartNode (this=0x829a458, deletedNode=0x84ac828) at kate/part/syntax/katecodefolding.cpp:626
#27 0xb25377cc in KateCodeFoldingTree::deleteNode (this=0x829a458, deletedNode=0x84ac828) at kate/part/syntax/katecodefolding.h:353
#28 0xb2536075 in KateCodeFoldingTree::updateMapping (this=0x829a458, line=13, newColumns=..., virtualNodeIndex=-1, virtualColumn=0) at kate/part/syntax/katecodefolding.cpp:1578
#29 0xb2535c9f in KateCodeFoldingTree::updateLine (this=0x829a458, line=13, regionChanges=..., updated=0xbfd59517, changed=true, colsChanged=false) at kate/part/syntax/katecodefolding.cpp:1504
#30 0xb24c9070 in KateBuffer::doHighlight (this=0x829a3d0, startLine=7, endLine=16, invalidate=false) at kate/part/document/katebuffer.cpp:706
#31 0xb24c7f30 in KateBuffer::ensureHighlighted (this=0x829a3d0, line=7) at kate/part/document/katebuffer.cpp:250
#32 0xb24b93e0 in KateDocument::kateTextLine (this=0x8299e90, i=7) at kate/part/document/katedocument.cpp:4786
#33 0xb24ff096 in KateLineLayout::textLine (this=0x84dbd10, reloadForce=true) at kate/part/render/katelinelayout.cpp:67
#34 0xb24faf7b in KateLayoutCache::line (this=0x829f780, realLine=7, virtualLine=6) at kate/part/render/katelayoutcache.cpp:298
#35 0xb2554c49 in KateViewInternal::viewLineOffset (this=0x82a2390, virtualCursor=..., offset=32, keepX=false) at kate/part/view/kateviewinternal.cpp:1327
#36 0xb2551b65 in KateViewInternal::makeVisible (this=0x82a2390, c=..., endCol=9, force=false, center=false, calledExternally=false) at kate/part/view/kateviewinternal.cpp:619
#37 0xb2557a04 in KateViewInternal::updateCursor (this=0x82a2390, newCursor=..., force=true, center=false, calledExternally=false) at kate/part/view/kateviewinternal.cpp:1844
#38 0xb25521b9 in KateViewInternal::slotRegionVisibilityChanged (this=0x82a2390) at kate/part/view/kateviewinternal.cpp:674
#39 0xb254f25b in KateViewInternal::qt_metacall (this=0x82a2390, _c=QMetaObject::InvokeMetaMethod, _id=16, _a=0xbfd59c0c) at kate/build/part/kateviewinternal.moc:130
#40 0xb5fe38ad in QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) () from /usr/lib/libQtCore.so.4
#41 0xb5ff3a0c in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#42 0xb2440605 in KateCodeFoldingTree::regionVisibilityChanged (this=0x829a458) at kate/build/part/moc_katecodefolding.cpp:121
#43 0xb2535856 in KateCodeFoldingTree::unfoldNode (this=0x829a458, node=0x84ac458) at kate/part/syntax/katecodefolding.cpp:1408
#44 0xb2532aa2 in KateCodeFoldingTree::deleteNodeFromMap (this=0x829a458, node=0x84ac458) at kate/part/syntax/katecodefolding.cpp:600
#45 0xb2532b3f in KateCodeFoldingTree::deleteStartNode (this=0x829a458, deletedNode=0x84ac458) at kate/part/syntax/katecodefolding.cpp:626
#46 0xb25377cc in KateCodeFoldingTree::deleteNode (this=0x829a458, deletedNode=0x84ac458) at kate/part/syntax/katecodefolding.h:353
#47 0xb2536075 in KateCodeFoldingTree::updateMapping (this=0x829a458, line=8, newColumns=..., virtualNodeIndex=-1, virtualColumn=0) at kate/part/syntax/katecodefolding.cpp:1578
#48 0xb2535c9f in KateCodeFoldingTree::updateLine (this=0x829a458, line=8, regionChanges=..., updated=0xbfd59e27, changed=true, colsChanged=false) at kate/part/syntax/katecodefolding.cpp:1504
#49 0xb24c9070 in KateBuffer::doHighlight (this=0x829a3d0, startLine=7, endLine=16, invalidate=false) at kate/part/document/katebuffer.cpp:706
#50 0xb24c7f30 in KateBuffer::ensureHighlighted (this=0x829a3d0, line=7) at kate/part/document/katebuffer.cpp:250
#51 0xb24b93e0 in KateDocument::kateTextLine (this=0x8299e90, i=7) at kate/part/document/katedocument.cpp:4786
#52 0xb24ff096 in KateLineLayout::textLine (this=0x84340d8, reloadForce=true) at kate/part/render/katelinelayout.cpp:67
#53 0xb24faf7b in KateLayoutCache::line (this=0x829f780, realLine=7, virtualLine=6) at kate/part/render/katelayoutcache.cpp:298
#54 0xb24fad46 in KateLayoutCache::updateViewCache (this=0x829f780, startPos=..., newViewLineCount=34, viewLinesScrolled=0) at kate/part/render/katelayoutcache.cpp:270
#55 0xb2558696 in KateViewInternal::tagLines (this=0x82a2390, start=..., end=..., realCursors=true) at kate/part/view/kateviewinternal.cpp:1975
#56 0xb2558462 in KateViewInternal::tagLines (this=0x82a2390, start=5, end=16, realLines=true) at kate/part/view/kateviewinternal.cpp:1945
#57 0xb25485fb in KateView::tagLines (this=0x829ef38, start=5, end=16, realLines=true) at kate/part/view/kateview.cpp:1682
#58 0xb24b248f in KateDocument::tagLines (this=0x8299e90, start=5, end=16) at kate/part/document/katedocument.cpp:3615
#59 0xb249fccc in KateDocument::qt_metacall (this=0x8299e90, _c=QMetaObject::InvokeMetaMethod, _id=51, _a=0xbfd5a3b4) at kate/build/part/katedocument.moc:350
#60 0xb5fe38ad in QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) () from /usr/lib/libQtCore.so.4
#61 0xb5ff3a0c in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#62 0xb24c73e3 in KateBuffer::tagLines (this=0x829a3d0, _t1=5, _t2=16) at kate/build/part/katebuffer.moc:98
#63 0xb24c91dc in KateBuffer::doHighlight (this=0x829a3d0, startLine=5, endLine=7, invalidate=true) at kate/part/document/katebuffer.cpp:736
#64 0xb24c769e in KateBuffer::editEnd (this=0x829a3d0) at kate/part/document/katebuffer.cpp:122
#65 0xb24a521e in KateDocument::editEnd (this=0x8299e90) at kate/part/document/katedocument.cpp:854
#66 0xb24a4c5f in KateDocument::removeText (this=0x8299e90, _range=..., block=false) at kate/part/document/katedocument.cpp:731
#67 0xb24ae30d in KateDocument::backspace (this=0x8299e90, view=0x829ef38, c=...) at kate/part/document/katedocument.cpp:2794
#68 0xb2552e5f in KateViewInternal::doBackspace (this=0x82a2390) at kate/part/view/kateviewinternal.cpp:799
Comment 2 Dominik Haumann 2012-02-24 15:18:52 UTC
Created attachment 69061 [details]
valgrind trace
Comment 3 Dominik Haumann 2012-02-24 17:55:14 UTC
Pushed by dhaumann into branch 'master'.

unit test for folding crash #294750

M  +10   -0    part/tests/CMakeLists.txt
A  +6    -4    part/tests/bug294750.cpp
A  +41   -0    part/tests/bug294750.h     [License: LGPL (v2+)]
M  +0    -1    part/tests/bug294756.cpp

http://commits.kde.org/kate/7c48c089f9daf0aa784a7ec33b5d63ee2983dc2e
Comment 4 Dominik Haumann 2012-03-16 18:53:35 UTC
Git commit 7f25a94366136af22b328d3a8831431585d9f647 by Dominik Haumann.
Committed on 16/03/2012 at 19:51.
Pushed by dhaumann into branch 'master'.

fix crash: no double deletion any more
Related: bug 294756

M  +34   -8    part/syntax/katecodefolding.cpp

http://commits.kde.org/kate/7f25a94366136af22b328d3a8831431585d9f647
Comment 5 Dominik Haumann 2012-03-20 18:34:17 UTC
Git commit 317755347b1f93ae06eb71dae663b1b60511913a by Dominik Haumann.
Committed on 16/03/2012 at 19:51.
Pushed by dhaumann into branch 'KDE/4.8'.

fix crash: no double deletion any more
Related: bug 294756

M  +34   -8    part/syntax/katecodefolding.cpp

http://commits.kde.org/kate/317755347b1f93ae06eb71dae663b1b60511913a
Comment 6 Dominik Haumann 2012-03-22 22:01:04 UTC
*** Bug 281181 has been marked as a duplicate of this bug. ***
Comment 7 Dominik Haumann 2012-03-22 22:14:39 UTC
*** Bug 294666 has been marked as a duplicate of this bug. ***
Comment 8 Dominik Haumann 2012-03-22 22:19:32 UTC
*** Bug 291150 has been marked as a duplicate of this bug. ***