Bug 200989 - (steps) Crash when pasting a XML snippet and selecting XML highlighting over a non-XML document (html file as testcase)
Summary: (steps) Crash when pasting a XML snippet and selecting XML highlighting over ...
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Unlisted Binaries Linux
: VHI crash
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
: 201636 210037 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-07-21 15:02 UTC by Fabian
Modified: 2009-10-11 00:14 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fabian 2009-07-21 15:02:56 UTC
Application that crashed: kate
Version of the application: 3.2.96
KDE Version: 4.2.96 (KDE 4.2.96 (KDE 4.3 RC2)) "release 142"
Qt Version: 4.5.2
Operating System: Linux 2.6.27.23-0.1-default x86_64
Distribution: "openSUSE 11.1 (x86_64)"

What I was doing when the application crashed:
Kate crashed when i selected xml highlighting.

I had not yet saved the file, but it contained a small valid xml document.

 -- Backtrace:
Application: Kate (kdeinit4), signal: Segmentation fault
[KCrash Handler]
#5  KateHighlighting::doHighlight (this=0x8ddb80, prevLine=0xc4f7c0, textLine=0xc84b50, foldingList=@0x7fff98d87eb0, ctxChanged=@0x7fff98d87edf) at /usr/include/QtCore/qvector.h:517
#6  0x00007fd07e23e34a in KateBuffer::doHighlight (this=0x961920, startLine=23, endLine=23, invalidate=false) at /usr/src/debug/kdelibs-4.2.96/kate/document/katebuffer.cpp:1086
#7  0x00007fd07e24022f in KateBuffer::ensureHighlighted (this=0x961920, line=<value optimized out>) at /usr/src/debug/kdelibs-4.2.96/kate/document/katebuffer.cpp:775
#8  0x00007fd07e22a899 in KateDocument::kateTextLine (this=0x83f1f0, i=2564324172) at /usr/src/debug/kdelibs-4.2.96/kate/document/katedocument.cpp:6012
#9  0x00007fd07e266728 in KateLineLayout::textLine (this=0xd6b170, reloadForce=<value optimized out>) at /usr/src/debug/kdelibs-4.2.96/kate/render/katelinelayout.cpp:67
#10 0x00007fd07e25c4dd in KateRenderer::layoutLine (this=0xafb060, lineLayout={d = 0x7fff98d88120}, maxwidth=-1730643124, cacheLayout=64)
    at /usr/src/debug/kdelibs-4.2.96/kate/render/katerenderer.cpp:763
#11 0x00007fd07e262c47 in KateLayoutCache::line (this=0xafe260, realLine=23, virtualLine=23) at /usr/src/debug/kdelibs-4.2.96/kate/render/katelayoutcache.cpp:309
#12 0x00007fd07e263b65 in KateLayoutCache::updateViewCache (this=0xafe260, startPos=@0xafe838, newViewLineCount=29, viewLinesScrolled=0)
    at /usr/src/debug/kdelibs-4.2.96/kate/render/katelayoutcache.cpp:262
#13 0x00007fd07e2b3c1a in KateViewInternal::doUpdateView (this=0xafe6b0, changed=true, viewLinesScrolled=0) at /usr/src/debug/kdelibs-4.2.96/kate/view/kateviewinternal.cpp:592
#14 0x00007fd07e2b43ed in KateViewInternal::updateView (this=0xafe6b0, changed=false, viewLinesScrolled=0) at /usr/src/debug/kdelibs-4.2.96/kate/view/kateviewinternal.cpp:568
#15 0x00007fd07e2a1b72 in KateView::updateView (this=0xaf8620, changed=false) at /usr/src/debug/kdelibs-4.2.96/kate/view/kateview.cpp:1627
#16 0x00007fd07e21a5f9 in KateDocument::updateConfig (this=0x83f1f0) at /usr/src/debug/kdelibs-4.2.96/kate/document/katedocument.cpp:5193
#17 0x00007fd07e23b485 in KateBuffer::setHighlight (this=0x961920, hlMode=<value optimized out>) at /usr/src/debug/kdelibs-4.2.96/kate/document/katebuffer.cpp:919
#18 0x00007fd07e213cf3 in KateDocument::setHighlightingMode (this=0x83f1f0, name=@0x7fff98d88580) at /usr/src/debug/kdelibs-4.2.96/kate/document/katedocument.cpp:2797
#19 0x00007fd07e28e466 in KateHighlightingMenu::setHl (this=0xb408f0) at /usr/src/debug/kdelibs-4.2.96/kate/syntax/katehighlightmenu.cpp:120
#20 0x00007fd07e28ee05 in KateHighlightingMenu::qt_metacall (this=0xb408f0, _c=QMetaObject::InvokeMetaMethod, _id=-1730643128, _a=<value optimized out>)
    at /usr/src/debug/kdelibs-4.2.96/build/kate/katehighlightmenu.moc:69
#21 0x00007fd0908906e2 in QMetaObject::activate (sender=0xcf9e10, from_signal_index=<value optimized out>, to_signal_index=6, argv=0x7fff98d87b40) at kernel/qobject.cpp:3113
#22 0x00007fd08dc15af7 in QAction::triggered (this=0xc84baa, _t1=true) at .moc/release-shared/moc_qaction.cpp:236
#23 0x00007fd08dc16f70 in QAction::activate (this=0xcf9e10, event=<value optimized out>) at kernel/qaction.cpp:1160
#24 0x00007fd08e000e1d in QMenuPrivate::activateCausedStack (this=0xcf2970, causedStack=@0x7fff98d887d0, action=0xcf9e10, action_e=QAction::Trigger, self=true) at widgets/qmenu.cpp:967
#25 0x00007fd08e006e5e in QMenuPrivate::activateAction (this=0xcf2970, action=0xcf9e10, action_e=QAction::Trigger, self=true) at widgets/qmenu.cpp:1060
#26 0x00007fd08dc6caed in QWidget::event (this=0xcf0630, event=0x7fff98d88fe0) at kernel/qwidget.cpp:7549
#27 0x00007fd08e0096ab in QMenu::event (this=0xcf0630, e=0x7fff98d88fe0) at widgets/qmenu.cpp:2353
#28 0x00007fd08dc1bb0d in QApplicationPrivate::notify_helper (this=0x680e10, receiver=0xcf0630, e=0x7fff98d88fe0) at kernel/qapplication.cpp:4056
#29 0x00007fd08dc244fa in QApplication::notify (this=<value optimized out>, receiver=0xcf0630, e=0x7fff98d88fe0) at kernel/qapplication.cpp:3758
#30 0x00007fd08ed0663b in KApplication::notify (this=0x7fff98d8afb0, receiver=0xcf0630, event=0x7fff98d88fe0) at /usr/src/debug/kdelibs-4.2.96/kdeui/kernel/kapplication.cpp:302
#31 0x00007fd09087b94c in QCoreApplication::notifyInternal (this=0x7fff98d8afb0, receiver=0xcf0630, event=0x7fff98d88fe0) at kernel/qcoreapplication.cpp:610
#32 0x00007fd08dc23748 in QApplicationPrivate::sendMouseEvent (receiver=0xcf0630, event=0x7fff98d88fe0, alienWidget=0x0, nativeWidget=0xcf0630, buttonDown=<value optimized out>, 
    lastMouseReceiver=@0x7fd08e62ff30) at ../../src/corelib/kernel/qcoreapplication.h:216
#33 0x00007fd08dc8d6c4 in QETWidget::translateMouseEvent (this=0xcf0630, event=<value optimized out>) at kernel/qapplication_x11.cpp:4341
#34 0x00007fd08dc8c543 in QApplication::x11ProcessEvent (this=0x7fff98d8afb0, event=0x7fff98d8ab60) at kernel/qapplication_x11.cpp:3548
#35 0x00007fd08dcb3864 in x11EventSourceDispatch (s=0x684570, callback=0, user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:146
#36 0x00007fd08c6fb0fb in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#37 0x00007fd08c6fe8cd in ?? () from /usr/lib64/libglib-2.0.so.0
#38 0x00007fd08c6fea8b in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#39 0x00007fd0908a4d3f in QEventDispatcherGlib::processEvents (this=0x617640, flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:327
#40 0x00007fd08dcb2fef in QGuiEventDispatcherGlib::processEvents (this=0xc84baa, flags=<value optimized out>) at kernel/qguieventdispatcher_glib.cpp:202
#41 0x00007fd09087a1d2 in QEventLoop::processEvents (this=<value optimized out>, flags={i = -1730630064}) at kernel/qeventloop.cpp:149
#42 0x00007fd09087a5a4 in QEventLoop::exec (this=0x7fff98d8ae90, flags={i = -1730629984}) at kernel/qeventloop.cpp:201
#43 0x00007fd09087c894 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:888
#44 0x00007fd084fc2e35 in kdemain () from /usr/lib64/libkdeinit4_kate.so
#45 0x0000000000407305 in launch (argc=1, _name=0x654c68 "/usr/bin/kate", args=<value optimized out>, cwd=0x0, envc=1, envs=0x654c8a "", reset_env=false, tty=0x0, avoid_loops=false, 
    startup_id_str=0x654c93 "atfabian;1248181078;836386;2470_TIME359201890") at /usr/src/debug/kdelibs-4.2.96/kinit/kinit.cpp:676
#46 0x0000000000407b28 in handle_launcher_request (sock=7, who=<value optimized out>) at /usr/src/debug/kdelibs-4.2.96/kinit/kinit.cpp:1168
#47 0x00000000004080d5 in handle_requests (waitForPid=0) at /usr/src/debug/kdelibs-4.2.96/kinit/kinit.cpp:1361
#48 0x0000000000408c16 in main (argc=2, argv=0x7fff98d8cd68, envp=0x7fff98d8cd80) at /usr/src/debug/kdelibs-4.2.96/kinit/kinit.cpp:1788

Reported using DrKonqi
Comment 1 Fabian 2009-07-21 15:13:36 UTC
I can reproduce the crash every time when I copy some xml in a document which was opend on startup and change the highlighting to xml.
Comment 2 Dario Andres 2009-07-21 15:24:47 UTC
Can you post some XML snippet that will cause Kate to crash? Thanks
Comment 3 Fabian 2009-07-21 16:17:35 UTC
Any XML I tried so far caused the crash eg:

<?xml version="1.0" encoding="UTF-8"?>
<xml>
	<test/>
</xml>
Comment 4 Dario Andres 2009-07-21 16:42:29 UTC
Here using:

Qt: 4.5.2 (KDE-Qt git commit 46a247a2c9a8c0c4456a02f6a0922d859d88fe76
        Date:   Fri Jun 26 13:45:37 2009 +0200)
KDE: 4.3.61 (KDE 4.3.61 (KDE 4.4 >= 20090717))
kdelibs svn rev. 999250 / kdebase svn rev. 999250
on ArchLinux i686 - Kernel 2.6.30.1

Opening Kate, pasting the provided XML snippet and selecting the "XML" highlighting didn't crashed the application.
Comment 5 Fabian 2009-07-21 16:54:37 UTC
Did you past it in an existing document (with activated highlighting different to html) and then switch the highlighting.

It does not crash when I past it in a new document, only when I past it in an existing document, with some different highlighting already active.
Comment 6 Dario Andres 2009-07-21 17:01:53 UTC
Thanks for the hint:

I could reproduce the crash with the same setup as I described in comment 4

The steps are:

- Open Kate
- Open a HTML document.
The html page will be loaded and the highlightning automatically set to "HTML"
- Copy the XML snippet
- Select all the html text (Ctrl+A) and paste the XML snippet over it
Now the document is only the XML snippet
- Go to Tools/Highlighting/Markup/XML

Kate crashes. (with the same backtrace as comment 0)

Updating the title to reflect the discovery.
Regards
Comment 7 Dominik Haumann 2009-07-21 17:33:31 UTC
can reproduce.
Comment 8 Dominik Haumann 2009-07-21 18:00:37 UTC
updated backtrace

Application: KWrite (kwrite), signal: Aborted
[KCrash Handler]
#5  0xb7eec430 in __kernel_vsyscall ()
#6  0xb68116d0 in raise () from /lib/tls/i686/cmov/libc.so.6
#7  0xb6813098 in abort () from /lib/tls/i686/cmov/libc.so.6
#8  0xb6aec74d in qt_message_output (msgType=QtFatalMsg, buf=0x9df0228 "ASSERT: \"0\" in file /home/dh/kde/trunk/kdelibs/kate/syntax/katehighlight.h, line 275")
    at /home/dh/kde/trunk/qt-copy/src/corelib/global/qglobal.cpp:2042
#9  0xb6aec807 in qFatal (msg=0xb6c206d8 "ASSERT: \"%s\" in file %s, line %d") at /home/dh/kde/trunk/qt-copy/src/corelib/global/qglobal.cpp:2241
#10 0xb6aec8c5 in qt_assert (assertion=0xb4a04fa7 "0", file=0xb4a04f70 "/home/dh/kde/trunk/kdelibs/kate/syntax/katehighlight.h", line=275)
    at /home/dh/kde/trunk/qt-copy/src/corelib/global/qglobal.cpp:1811
#11 0xb4927c67 in KateHighlighting::contextNum (this=0x9a83d88, n=0) at /home/dh/kde/trunk/kdelibs/kate/syntax/katehighlight.h:275
#12 0xb4923095 in KateHighlighting::doHighlight (this=0x9a83d88, prevLine=0x9fa28d0, textLine=0x9ee3000, foldingList=@0xbfc07968, ctxChanged=@0xbfc07997)
    at /home/dh/kde/trunk/kdelibs/kate/syntax/katehighlight.cpp:272
#13 0xb48dbb63 in KateBuffer::doHighlight (this=0x9aa36d8, startLine=3, endLine=3, invalidate=false) at /home/dh/kde/trunk/kdelibs/kate/document/katebuffer.cpp:1086
#14 0xb48dce0a in KateBuffer::ensureHighlighted (this=0x9aa36d8, line=3) at /home/dh/kde/trunk/kdelibs/kate/document/katebuffer.cpp:775
#15 0xb48b0d52 in KateDocument::kateTextLine (this=0x9a0f960, i=3) at /home/dh/kde/trunk/kdelibs/kate/document/katedocument.cpp:6052
#16 0xb4908cdd in KateLineLayout::textLine (this=0x9f7c6e8, reloadForce=false) at /home/dh/kde/trunk/kdelibs/kate/render/katelinelayout.cpp:67
#17 0xb48fa6f7 in KateRenderer::layoutLine (this=0x9aa3780, lineLayout={d = 0xbfc07b44}, maxwidth=-1, cacheLayout=true) at /home/dh/kde/trunk/kdelibs/kate/render/katerenderer.cpp:806
#18 0xb49039b6 in KateLayoutCache::line (this=0x9ae1708, realLine=3, virtualLine=3) at /home/dh/kde/trunk/kdelibs/kate/render/katelayoutcache.cpp:312
#19 0xb4904b2e in KateLayoutCache::updateViewCache (this=0x9ae1708, startPos=@0x9ae1870, newViewLineCount=24, viewLinesScrolled=0) at /home/dh/kde/trunk/kdelibs/kate/render/katelayoutcache.cpp:265
#20 0xb4951e40 in KateViewInternal::doUpdateView (this=0x9ae1788, changed=true, viewLinesScrolled=0) at /home/dh/kde/trunk/kdelibs/kate/view/kateviewinternal.cpp:594
#21 0xb4952701 in KateViewInternal::updateView (this=0x9ae1788, changed=true, viewLinesScrolled=0) at /home/dh/kde/trunk/kdelibs/kate/view/kateviewinternal.cpp:570
#22 0xb493c191 in KateView::updateView (this=0x9adffb0, changed=true) at /home/dh/kde/trunk/kdelibs/kate/view/kateview.cpp:1647
#23 0xb493d8ba in KateView::updateDocumentConfig (this=0x9adffb0) at /home/dh/kde/trunk/kdelibs/kate/view/kateview.cpp:1521
#24 0xb48b3184 in KateDocument::updateConfig (this=0x9a0f960) at /home/dh/kde/trunk/kdelibs/kate/document/katedocument.cpp:5230
#25 0xb49bb4de in KateDocumentConfig::updateConfig (this=0x9aa33d8) at /home/dh/kde/trunk/kdelibs/kate/utils/kateconfig.cpp:227
#26 0xb49b53a8 in KateConfig::configEnd (this=0x9aa33d8) at /home/dh/kde/trunk/kdelibs/kate/utils/kateconfig.cpp:77
#27 0xb49b7c9c in KateDocumentConfig::setIndentationMode (this=0x9aa33d8, indentationMode=@0xbfc07e50) at /home/dh/kde/trunk/kdelibs/kate/utils/kateconfig.cpp:295
#28 0xb48da503 in KateBuffer::setHighlight (this=0x9aa36d8, hlMode=56) at /home/dh/kde/trunk/kdelibs/kate/document/katebuffer.cpp:919
#29 0xb48b1c4b in KateDocument::setHighlightingMode (this=0x9a0f960, name=@0x9f5f878) at /home/dh/kde/trunk/kdelibs/kate/document/katedocument.cpp:2803
Comment 9 Dario Andres 2009-07-28 14:08:37 UTC
*** Bug 201636 has been marked as a duplicate of this bug. ***
Comment 10 Dario Andres 2009-10-10 01:54:58 UTC
*** Bug 210037 has been marked as a duplicate of this bug. ***
Comment 11 Pascal Létourneau 2009-10-10 23:27:12 UTC
SVN commit 1033721 by pletourn:

Don't change the indentation mode in the middle
of changing the highlighting mode

BUG:200989


 M  +4 -4      katebuffer.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1033721
Comment 12 Dominik Haumann 2009-10-11 00:14:51 UTC
SVN commit 1033735 by dhaumann:

backport SVN commit 1033721 by pletourn:

Don't change the indentation mode in the middle
of changing the highlighting mode

CCBUG:200989


 M  +4 -4      katebuffer.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1033735