Bug 190305 - Crash when using Ctrl and Del
Summary: Crash when using Ctrl and Del
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: VHI crash
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-21 23:22 UTC by Albert Astals Cid
Modified: 2009-04-22 20:59 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
The said file (6 bytes, text/plain)
2009-04-21 23:22 UTC, Albert Astals Cid
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Albert Astals Cid 2009-04-21 23:22:24 UTC
Version:           3.2.2 (using 4.2.2 (KDE 4.2.2), Kubuntu packages)
Compiler:          cc
OS:                Linux (x86_64) release 2.6.28-11-generic

Pressing Ctrl+Del in the first line/column of the attachment document makes kate assert 

ASSERT: "d" in file /home/kde42/kdelibs/kdecore/util/ksharedptr.h, line 120

The backtrace is 

#0  0x00007f8fb22a0fb5 in raise () from /lib/libc.so.6
#1  0x00007f8fb22a2bc3 in abort () from /lib/libc.so.6
#2  0x00007f8fb3009dc5 in qt_message_output (msgType=QtFatalMsg, buf=<value optimized out>) at global/qglobal.cpp:2102
#3  0x00007f8fb3009f0d in qFatal (msg=<value optimized out>) at global/qglobal.cpp:2303
#4  0x00007f8fa9e814ec in KSharedPtr<KateLineLayout>::operator-> (this=0x7fffbe2317e0) at /home/kde42/kdelibs/kdecore/util/ksharedptr.h:120
#5  0x00007f8fa9e86d62 in KateLayoutCache::viewLine (this=0x1a350c0, realCursor=@0x1a35dd0) at /home/kde42/kdelibs/kate/render/katelayoutcache.cpp:376
#6  0x00007f8fa9e87164 in KateLayoutCache::textLayout (this=0x1a350c0, realCursor=@0x1a35dd0) at /home/kde42/kdelibs/kate/render/katelayoutcache.cpp:325
#7  0x00007f8fa9ed2bb2 in KateViewInternal::makeVisible (this=0x1a35cc0, c=@0x1a35dd0, endCol=2, force=false, center=false, calledExternally=false)
    at /home/kde42/kdelibs/kate/view/kateviewinternal.cpp:664
#8  0x00007f8fa9ed6710 in KateViewInternal::editEnd (this=0x1a35cc0, editTagLineStart=1, editTagLineEnd=1, tagFrom=true) at /home/kde42/kdelibs/kate/view/kateviewinternal.cpp:3344
#9  0x00007f8fa9ebcc7f in KateView::editEnd (this=0x1a32f70, editTagLineStart=1, editTagLineEnd=1, tagFrom=true) at /home/kde42/kdelibs/kate/view/kateview.cpp:1546
#10 0x00007f8fa9e4be80 in KateDocument::editEnd (this=0x17fa050) at /home/kde42/kdelibs/kate/document/katedocument.cpp:1075
#11 0x00007f8fa9ed6505 in KateViewInternal::doDeleteWordRight (this=0x1a35cc0) at /home/kde42/kdelibs/kate/view/kateviewinternal.cpp:841
#12 0x00007f8fa9eb94b8 in KateView::deleteWordRight (this=0x1a32f70) at /home/kde42/kdelibs/kate/view/kateview.cpp:2496
Comment 1 Albert Astals Cid 2009-04-21 23:22:54 UTC
Created attachment 33000 [details]
The said file
Comment 2 Christoph Cullmann 2009-04-22 15:08:26 UTC
Hmm, Kate thinks:

(gdb) print thisLine
$1 = {d = 0x0}
(gdb) print realCursor.line()
$2 = 1
(gdb) print realCursor.line()
$3 = 1
(gdb) print m_renderer->doc()->lines()
Cannot evaluate function -- may be inlined
(gdb) print m_renderer
$4 = (KateRenderer *) 0xdc2530
(gdb) print m_renderer->m_doc
$5 = (class KateDocument *) 0xc79570
(gdb) print m_renderer->m_doc->lines()
Cannot access memory at address 0x10
(gdb) print m_renderer->m_doc->m_buffer
$6 = (class KateBuffer *) 0xdbdd90
(gdb) print m_renderer->m_doc->m_buffer->m_lines
$7 = 1

Interesting, only one line for kate, but it tries to do stuff in second line...
Comment 3 Christoph Cullmann 2009-04-22 15:18:45 UTC
Hmm, somewho that's wrong, I guess the problem is, that line 2 was removed there already...
Comment 4 Christoph Cullmann 2009-04-22 15:55:57 UTC
SVN commit 957574 by cullmann:

Fix the segfault, don't know, why this case was introduced, but have no idea how that should ever have worked in general
displayCursor needs to be up to date...
BUG: 190305


 M  +1 -5      kateviewinternal.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=957574
Comment 5 Dominik Haumann 2009-04-22 19:21:22 UTC
Albert, can you check if this also fixes bug #178379 in the right way? Then we could remove the blame-fix again.
Comment 6 Albert Astals Cid 2009-04-22 19:50:49 UTC
Yes it does, should i remove my hack and backport this bugfix to 4.2?
Comment 7 Christoph Cullmann 2009-04-22 20:30:06 UTC
Would be great ;)
Comment 8 Dominik Haumann 2009-04-22 20:32:14 UTC
Awesome! :)
Comment 9 Albert Astals Cid 2009-04-22 20:59:12 UTC
Done