Bug 278602 - Kate crashes
Summary: Kate crashes
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: folding (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: VHI crash
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-27 06:12 UTC by Unknown
Modified: 2011-07-28 14:19 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
New crash information added by DrKonqi (7.57 KB, text/plain)
2011-07-27 06:15 UTC, Unknown
Details
New crash information added by DrKonqi (6.20 KB, text/plain)
2011-07-27 06:25 UTC, Unknown
Details
broken file (4.73 KB, text/plain)
2011-07-27 19:38 UTC, Unknown
Details
New crash information added by DrKonqi (12.24 KB, text/plain)
2011-07-27 19:54 UTC, Unknown
Details
New crash information added by DrKonqi (12.54 KB, text/plain)
2011-07-27 19:56 UTC, Unknown
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Unknown 2011-07-27 06:12:04 UTC
Application: kate (3.7.40)
KDE Platform Version: 4.7.40 (4.7.40 (KDE 4.8 >= 200110623) (Compiled from sources)
Qt Version: 4.7.3
Operating System: Linux 3.0.0-7-generic x86_64
Distribution: Ubuntu oneiric (development branch)

-- Information about the crash:
- What I was doing when the application crashed:
Hit backspace on a selected bit of python code and it crashed. Happened quite a few times when deleting/writing characters today...

Last few lines:
kate(14606)/kate-filetree KateFileTreeModel::documentModifiedChanged: BEGIN!
kate(14606)/kate-filetree KateFileTreeModel::documentModifiedChanged: modified!
kate(14606)/kate-filetree KateFileTreeModel::setupIcon: BEGIN!
kate(14606)/kate-filetree KateFileTreeModel::setupIcon: END!
kate(14606)/kate-filetree KateFileTreeModel::documentModifiedChanged: END!
kate(14606)/kate-filetree KateFileTreeModel::documentModifiedChanged: BEGIN!
kate(14606)/kate-filetree KateFileTreeModel::documentModifiedChanged: saved!
kate(14606)/kate-filetree KateFileTreeModel::setupIcon: BEGIN!
kate(14606)/kate-filetree KateFileTreeModel::setupIcon: END!
kate(14606)/kate-filetree KateFileTreeModel::documentModifiedChanged: END!
kate(14606)/kate-filetree KateFileTreeModel::documentModifiedChanged: BEGIN!
kate(14606)/kate-filetree KateFileTreeModel::documentModifiedChanged: modified!
kate(14606)/kate-filetree KateFileTreeModel::setupIcon: BEGIN!
kate(14606)/kate-filetree KateFileTreeModel::setupIcon: END!
kate(14606)/kate-filetree KateFileTreeModel::documentModifiedChanged: END!
KCrash: Application 'kate' crashing...
KCrash: Attempting to start /usr/local/lib/kde4/libexec/drkonqi from kdeinit
sock_file=/home/adys/.kde/socket-azura/kdeinit4__0

The crash can be reproduced some of the time.

-- Backtrace:
Application: Kate (kate), signal: Segmentation fault
[Current thread is 1 (Thread 0x7f7b6a6e9780 (LWP 14606))]

Thread 2 (Thread 0x7f7b5aa76700 (LWP 14691)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:162
#1  0x00007f7b5bf37d82 in ?? () from /usr/lib/libQtScript.so.4
#2  0x00007f7b5bf37db9 in ?? () from /usr/lib/libQtScript.so.4
#3  0x00007f7b67628d8c in start_thread (arg=0x7f7b5aa76700) at pthread_create.c:304
#4  0x00007f7b6a03c1dd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#5  0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7f7b6a6e9780 (LWP 14606)):
[KCrash Handler]
#6  KateCodeFoldingNode::setParent (this=0x22bdb30) at /home/adys/src/kde/kate/part/syntax/katecodefolding.cpp:289
#7  0x00007f7b5c5f5347 in KateCodeFoldingNode::updateSelf (this=0x22bdb30) at /home/adys/src/kde/kate/part/syntax/katecodefolding.cpp:388
#8  0x00007f7b5c5f8455 in KateCodeFoldingTree::deleteEndNode (this=<value optimized out>, deletedNode=0x2449510) at /home/adys/src/kde/kate/part/syntax/katecodefolding.cpp:506
#9  0x00007f7b5c5f9845 in deleteNode (this=0x15a4bd0, line=139, newColumns=<value optimized out>) at /home/adys/src/kde/kate/part/syntax/katecodefolding.h:331
#10 KateCodeFoldingTree::updateMapping (this=0x15a4bd0, line=139, newColumns=<value optimized out>) at /home/adys/src/kde/kate/part/syntax/katecodefolding.cpp:1308
#11 0x00007f7b5c5f99ca in KateCodeFoldingTree::updateLine (this=<value optimized out>, line=<value optimized out>, regionChanges=<value optimized out>, updated=0x7fff8365599e, changed=<value optimized out>, colsChanged=<value optimized out>) at /home/adys/src/kde/kate/part/syntax/katecodefolding.cpp:1248
#12 0x00007f7b5c597eac in KateBuffer::doHighlight (this=<value optimized out>, startLine=137, endLine=139, invalidate=true) at /home/adys/src/kde/kate/part/document/katebuffer.cpp:691
#13 0x00007f7b5c59945f in KateBuffer::editEnd (this=0x15a4b00) at /home/adys/src/kde/kate/part/document/katebuffer.cpp:123
#14 0x00007f7b5c57fbbc in editEnd (this=0x15a4300) at /home/adys/src/kde/kate/part/document/katedocument.cpp:852
#15 KateDocument::editEnd (this=0x15a4300) at /home/adys/src/kde/kate/part/document/katedocument.cpp:833
#16 0x00007f7b5c600c09 in removeSelectedText (this=0x13bf6d0) at /home/adys/src/kde/kate/part/view/kateview.cpp:1815
#17 KateView::removeSelectedText (this=0x13bf6d0) at /home/adys/src/kde/kate/part/view/kateview.cpp:1800
#18 0x00007f7b5c58437c in KateDocument::backspace (this=0x15a4300, view=0x13bf6d0, c=...) at /home/adys/src/kde/kate/part/document/katedocument.cpp:2748
#19 0x00007f7b5c60fd31 in KateViewInternal::doBackspace (this=0x16c1d60) at /home/adys/src/kde/kate/part/view/kateviewinternal.cpp:799
#20 0x00007f7b5c60e3ad in KateView::qt_metacall (this=0x13bf6d0, _c=QMetaObject::InvokeMetaMethod, _id=49, _a=0x7fff83655d90) at /home/adys/src/kde/kate/build/part/kateview.moc:373
#21 0x00007f7b67efb6ea in QMetaObject::activate (sender=0x18103d0, m=<value optimized out>, local_signal_index=<value optimized out>, argv=0x7fff83655d90) at kernel/qobject.cpp:3278
#22 0x00007f7b69471892 in QAction::triggered (this=<value optimized out>, _t1=false) at .moc/release-shared/moc_qaction.cpp:263
#23 0x00007f7b69471a7f in QAction::activate (this=0x18103d0, event=<value optimized out>) at kernel/qaction.cpp:1257
#24 0x00007f7b69471bef in QAction::event (this=<value optimized out>, e=<value optimized out>) at kernel/qaction.cpp:1183
#25 0x00007f7b685fefaa in KAction::event (this=<value optimized out>, event=0x7fff83656220) at /home/adys/src/kde/kdelibs/kdeui/actions/kaction.cpp:131
#26 0x00007f7b69478154 in notify_helper (this=0xdcf800, receiver=0x18103d0, e=0x7fff83656220) at kernel/qapplication.cpp:4467
#27 QApplicationPrivate::notify_helper (this=0xdcf800, receiver=0x18103d0, e=0x7fff83656220) at kernel/qapplication.cpp:4439
#28 0x00007f7b6947cfc1 in QApplication::notify (this=0x7fff83657500, receiver=0x18103d0, e=0x7fff83656220) at kernel/qapplication.cpp:4346
#29 0x00007f7b686e5786 in KApplication::notify (this=0x7fff83657500, receiver=0x18103d0, event=0x7fff83656220) at /home/adys/src/kde/kdelibs/kdeui/kernel/kapplication.cpp:311
#30 0x00007f7b67ee8a6c in QCoreApplication::notifyInternal (this=0x7fff83657500, receiver=0x18103d0, event=0x7fff83656220) at kernel/qcoreapplication.cpp:731
#31 0x00007f7b694aa149 in sendEvent (this=<value optimized out>, e=0x7fff83656630) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:215
#32 QShortcutMap::dispatchEvent (this=<value optimized out>, e=0x7fff83656630) at kernel/qshortcutmap.cpp:879
#33 0x00007f7b694ab61a in QShortcutMap::tryShortcutEvent (this=0xdcf928, o=<value optimized out>, e=0x7fff83656630) at kernel/qshortcutmap.cpp:364
#34 0x00007f7b6947e842 in QApplication::notify (this=0x7fff83657500, receiver=0x16c1d60, e=0x7fff83656630) at kernel/qapplication.cpp:3909
#35 0x00007f7b686e5786 in KApplication::notify (this=0x7fff83657500, receiver=0x16c1d60, event=0x7fff83656630) at /home/adys/src/kde/kdelibs/kdeui/kernel/kapplication.cpp:311
#36 0x00007f7b67ee8a6c in QCoreApplication::notifyInternal (this=0x7fff83657500, receiver=0x16c1d60, event=0x7fff83656630) at kernel/qcoreapplication.cpp:731
#37 0x00007f7b6951b649 in QKeyMapper::sendKeyEvent (keyWidget=0x16c1d60, grab=<value optimized out>, type=QEvent::KeyPress, code=16777219, modifiers=..., text=..., autorepeat=false, count=1, nativeScanCode=22, nativeVirtualKey=65288, nativeModifiers=16) at kernel/qkeymapper_x11.cpp:1866
#38 0x00007f7b6951babb in QKeyMapperPrivate::translateKeyEvent (this=0xe07a70, keyWidget=0x16c1d60, event=0x7fff83657070, grab=false) at kernel/qkeymapper_x11.cpp:1836
#39 0x00007f7b694f6be7 in QApplication::x11ProcessEvent (this=0x7fff83657500, event=0x7fff83657070) at kernel/qapplication_x11.cpp:3577
#40 0x00007f7b6951fac2 in x11EventSourceDispatch (s=0xdd3f30, callback=0, user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:146
#41 0x00007f7b671575bd in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#42 0x00007f7b67157db8 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#43 0x00007f7b67157f89 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#44 0x00007f7b67f13746 in QEventDispatcherGlib::processEvents (this=0xda6a10, flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:422
#45 0x00007f7b6951f72e in QGuiEventDispatcherGlib::processEvents (this=<value optimized out>, flags=<value optimized out>) at kernel/qguieventdispatcher_glib.cpp:204
#46 0x00007f7b67ee7c62 in QEventLoop::processEvents (this=<value optimized out>, flags=...) at kernel/qeventloop.cpp:149
#47 0x00007f7b67ee7e67 in QEventLoop::exec (this=0x7fff83657440, flags=...) at kernel/qeventloop.cpp:201
#48 0x00007f7b67eec07b in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1008
#49 0x00007f7b6a3020c5 in kdemain (argc=<value optimized out>, argv=<value optimized out>) at /home/adys/src/kde/kate/kate/app/katemain.cpp:377
#50 0x00007f7b69f74e1f in __libc_start_main (main=0x400630 <main(int, char**)>, argc=1, ubp_av=0x7fff83658a38, init=<value optimized out>, fini=<value optimized out>, rtld_fini=<value optimized out>, stack_end=0x7fff83658a28) at libc-start.c:226
#51 0x0000000000400661 in _start ()

Reported using DrKonqi
Comment 1 Unknown 2011-07-27 06:15:10 UTC
Created attachment 62229 [details]
New crash information added by DrKonqi

kate (3.7.40) on KDE Platform 4.7.40 (4.7.40 (KDE 4.8 >= 200110623) using Qt 4.7.3

- What I was doing when the application crashed:

Additional backtrace. 100% repro when deleting a specific set of two lines.

-- Backtrace (Reduced):
#6  KateCodeFoldingNode::setParent (this=0x28160e0) at /home/adys/src/kde/kate/part/syntax/katecodefolding.cpp:289
#7  0x00007f58ea342347 in KateCodeFoldingNode::updateSelf (this=0x28160e0) at /home/adys/src/kde/kate/part/syntax/katecodefolding.cpp:388
#8  0x00007f58ea345455 in KateCodeFoldingTree::deleteEndNode (this=<value optimized out>, deletedNode=0x28168e0) at /home/adys/src/kde/kate/part/syntax/katecodefolding.cpp:506
#9  0x00007f58ea346845 in deleteNode (this=0x269c120, line=155, newColumns=<value optimized out>) at /home/adys/src/kde/kate/part/syntax/katecodefolding.h:331
#10 KateCodeFoldingTree::updateMapping (this=0x269c120, line=155, newColumns=<value optimized out>) at /home/adys/src/kde/kate/part/syntax/katecodefolding.cpp:1308
Comment 2 Unknown 2011-07-27 06:19:25 UTC
Turning code folding off didn't help.
Comment 3 Unknown 2011-07-27 06:25:27 UTC
Created attachment 62230 [details]
New crash information added by DrKonqi

kate (3.7.40) on KDE Platform 4.7.40 (4.7.40 (KDE 4.8 >= 200110623) using Qt 4.7.3

Different crash, by deleting characters up to the tab indentation.

- What I  was doing when the application crashed:

- Unusual behavior I noticed:

- Custom settings of the application:

-- Backtrace (Reduced):
#6  KateCodeFoldingNode::removeEnd (this=0x1533750, node=0x1533f50) at /home/adys/src/kde/kate/part/syntax/katecodefolding.cpp:208
#7  0x00007f4c65a5204d in removeChild (this=<value optimized out>, node=0x1533f50) at /home/adys/src/kde/kate/part/syntax/katecodefolding.cpp:255
#8  KateCodeFoldingNode::removeChild (this=<value optimized out>, node=0x1533f50) at /home/adys/src/kde/kate/part/syntax/katecodefolding.cpp:248
#9  0x00007f4c65a55435 in KateCodeFoldingTree::deleteEndNode (this=<value optimized out>, deletedNode=0x1533f50) at /home/adys/src/kde/kate/part/syntax/katecodefolding.cpp:502
#10 0x00007f4c65a56845 in deleteNode (this=0x13ad340, line=157, newColumns=<value optimized out>) at /home/adys/src/kde/kate/part/syntax/katecodefolding.h:331
Comment 4 Dominik Haumann 2011-07-27 07:01:17 UTC
What helps us more is a valgrind trace:
valgrind --tool=memcheck kate
See: http://techbase.kde.org/Development/Tools/Valgrind
Comment 5 Milian Wolff 2011-07-27 07:39:12 UTC
much more useful valgrind invokation:

valgrind --track-origins=yes --num-callers=25 kate

(tool=memcheck is default, the other stuff I pass along is not).
Comment 6 Adrian 2011-07-27 10:06:13 UTC
(In reply to comment #1)
> Created an attachment (id=62229) [details]
> New crash information added by DrKonqi
> 
> kate (3.7.40) on KDE Platform 4.7.40 (4.7.40 (KDE 4.8 >= 200110623) using Qt
> 4.7.3
> 
> - What I was doing when the application crashed:
> 
> Additional backtrace. 100% repro when deleting a specific set of two lines.

Please attach the file and tell as what is the set of lines you are talking about so I can reproduce it too.
Tanks
Comment 7 Adrian 2011-07-27 10:16:20 UTC
(In reply to comment #6)
> (In reply to comment #1)
> > Created an attachment (id=62229) [details] [details]
> > New crash information added by DrKonqi
> > 
> > kate (3.7.40) on KDE Platform 4.7.40 (4.7.40 (KDE 4.8 >= 200110623) using Qt
> > 4.7.3
> > 
> > - What I was doing when the application crashed:
> > 
> > Additional backtrace. 100% repro when deleting a specific set of two lines.
> 
Please, attach the file and tell us what is the set of lines you were talking about so I can reproduce the bug too.
Thanks!

(Sorry for the misspellings from the previous comment)
Comment 8 Adrian 2011-07-27 13:12:47 UTC
I couldn't reproduce the bug because I didn't have that particular file, but I could reproduce a very similar bug and fixed it. 
Jarome, please confirm that you can't reproduce your bug anymore, please.
Comment 9 Unknown 2011-07-27 19:37:04 UTC
Hi Adrian,

This is not fixed for me, although I'm not sure anything was committed to master. Is it on a special branch?
Comment 10 Unknown 2011-07-27 19:38:20 UTC
Created attachment 62250 [details]
broken file

Try deleting, char by char, line 183. It crashes when reaching the tab.
					if nslang == lang:
Comment 11 Unknown 2011-07-27 19:43:02 UTC
It doesn't crash under Valgrind, btw.
Comment 12 Adrian 2011-07-27 19:49:49 UTC
Git commit 658f25be8f64a7adfd8c7378ad05a0aecb94d332 by Adrian Lungu.
Committed on 27/07/2011 at 15:08.
Pushed by lungu into branch 'master'.

BUG: 278602
There was a problem in mergeChildren() method because different nodes
with equals positions were interpreted as the same node => duplicates

M  +22   -2    part/syntax/katecodefolding.cpp

http://commits.kde.org/kate/658f25be8f64a7adfd8c7378ad05a0aecb94d332
Comment 13 Unknown 2011-07-27 19:54:15 UTC
Created attachment 62251 [details]
New crash information added by DrKonqi

kate (3.7.40) on KDE Platform 4.7.40 (4.7.40 (KDE 4.8 >= 200110623) using Qt 4.7.3

Adrian, thanks, it works better now.

There are still some issues with lines overlapping each other, I'll attach a screenshot.  I also got this crash somehow.

-- Backtrace (Reduced):
#6  getDepth (this=<value optimized out>, line=133, validEndings=<value optimized out>) at /home/adys/src/kde/kate/part/syntax/katecodefolding.cpp:115
#7  KateCodeFoldingTree::getLineDepth (this=<value optimized out>, line=133, validEndings=<value optimized out>) at /home/adys/src/kde/kate/part/syntax/katecodefolding.cpp:787
#8  0x00007f028e095d73 in KateCodeFoldingTree::getLineDepth (this=0x20a53e0, line=133) at /home/adys/src/kde/kate/part/syntax/katecodefolding.cpp:754
#9  0x00007f028e095e68 in KateCodeFoldingTree::getLineInfo (this=0x20a53e0, info=0x7fff99d22f30, line=133) at /home/adys/src/kde/kate/part/syntax/katecodefolding.cpp:806
#10 0x00007f028e0be804 in KateIconBorder::paintBorder (this=0x22c7080, y=<value optimized out>, height=846) at /home/adys/src/kde/kate/part/view/kateviewhelpers.cpp:1081
Comment 14 Unknown 2011-07-27 19:56:57 UTC
Created attachment 62252 [details]
New crash information added by DrKonqi

kate (3.7.40) on KDE Platform 4.7.40 (4.7.40 (KDE 4.8 >= 200110623) using Qt 4.7.3

Another crash / different backtrace. Don't know if it helps -  sorry for the spam if it doesn't :)

-- Backtrace (Reduced):
#9  operator= (this=0x1ba2bf0) at ../../include/QtCore/../../src/corelib/tools/qlist.h:433
#10 operator= (this=0x1ba2bf0) at text/qtextlayout.cpp:545
#11 QTextLayout::additionalFormats (this=0x1ba2bf0) at text/qtextlayout.cpp:551
#12 0x00007fa7e19d2636 in KateRenderer::paintTextLine (this=0x171d1d0, paint=..., range=..., xStart=0, xEnd=1398, cursor=0x7fff56460c10) at /home/adys/src/kde/kate/part/render/katerenderer.cpp:538
#13 0x00007fa7e1a28532 in KateViewInternal::paintEvent (this=0x1bfa990, e=0x7fff564612e0) at /home/adys/src/kde/kate/part/view/kateviewinternal.cpp:2911
Comment 15 Adrian 2011-07-27 20:00:04 UTC
Please tell me what you were doing when it crashed, please.
I can't understand too much from the backtrace.
Comment 16 Adrian 2011-07-27 20:02:26 UTC
I am interested in bug from comment no 13 especially, because it's code folding related.
Comment 17 Unknown 2011-07-27 20:04:12 UTC
Ok; the last crash was from a ctrl-z. Honestly, I'm just deleting lines/chars  around the buggy line from earlier on and then doing ctrl+z, I can't figure out a 100% but it crashes pretty easily.
Comment 18 Adrian 2011-07-28 14:08:06 UTC
Git commit 6496232a62c6fa8177d1581b11abc67eb244be8b by Adrian Lungu.
Committed on 28/07/2011 at 16:07.
Pushed by lungu into branch 'master'.

BUG: 278602
This patch is solving the others bugs reported in this bug's comments.
removeEnd() method was replaced with removeEndAscending() and
removeEndDescending() (there were some node duplicates into the leafs ->
solved with removeEndAscending())

M  +5    -3    part/syntax/katecodefolding.h
M  +76   -21   part/syntax/katecodefolding.cpp

http://commits.kde.org/kate/6496232a62c6fa8177d1581b11abc67eb244be8b
Comment 19 Adrian 2011-07-28 14:19:32 UTC
(In reply to comment #17)
> Ok; the last crash was from a ctrl-z. Honestly, I'm just deleting lines/chars 
> around the buggy line from earlier on and then doing ctrl+z, I can't figure out
> a 100% but it crashes pretty easily.

It's done :) 
Deleting should work for as many lines as you wish.
Thank you very much for your report and your file, Jerome. It really helped me a lot.
If you do find any other bugs, please let us know and we'll try to solve it.

Greetings,
Adrian