Bug 323278 - Comment error produces crash
Summary: Comment error produces crash
Status: RESOLVED NOT A BUG
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: 3.10.5
Platform: Fedora RPMs Linux
: NOR crash
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords: drkonqi
Depends on:
Blocks:
 
Reported: 2013-08-08 05:05 UTC by hansoa2
Modified: 2013-12-08 03:11 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description hansoa2 2013-08-08 05:05:59 UTC
Application: kate (3.10.5)
KDE Platform Version: 4.10.5
Qt Version: 4.8.4
Operating System: Linux 3.9.10-100.fc17.x86_64 x86_64
Distribution: "Fedora release 17 (Beefy Miracle)"

-- Information about the crash:
- What I was doing when the application crashed:
I had a highlight file with comments like so:
<!-- ... <!-- ... -->
This should parse as one comment, right? But an error occured.

-- Backtrace:
Application: Kate (kate), signal: Segmentation fault
Using host libthread_db library "/lib64/libthread_db.so.1".
82	T_PSEUDO (SYSCALL_SYMBOL, SYSCALL_NAME, SYSCALL_NARGS)
[Current thread is 1 (Thread 0x7f7ab72ac880 (LWP 14544))]

Thread 2 (Thread 0x7f7aaa0c1700 (LWP 14545)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:166
#1  0x0000003461586797 in QTWTF::TCMalloc_PageHeap::scavengerThread (this=0x3461894640) at ../3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp:2359
#2  0x00000034615867c9 in QTWTF::TCMalloc_PageHeap::runScavengerThread (context=<optimized out>) at ../3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp:1464
#3  0x000000343c807d14 in start_thread (arg=0x7f7aaa0c1700) at pthread_create.c:309
#4  0x000000343bcf168d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115

Thread 1 (Thread 0x7f7ab72ac880 (LWP 14544)):
[KCrash Handler]
#6  ref (this=0x0) at /usr/include/QtCore/qatomic_x86_64.h:121
#7  QString (other=..., this=0x7fff923b0450) at /usr/include/QtCore/qstring.h:726
#8  hlKeyForAttrib (i=<optimized out>, this=0x249bea0) at /usr/src/debug/kate-4.10.5/part/syntax/katehighlight.cpp:1041
#9  KateHighlighting::getCommentStart (this=0x249bea0, attrib=<optimized out>) at /usr/src/debug/kate-4.10.5/part/syntax/katehighlight.cpp:1081
#10 0x00007f7aaa9b919f in KateView::slotHlChanged (this=this@entry=0x2ce64e0) at /usr/src/debug/kate-4.10.5/part/view/kateview.cpp:1836
#11 0x00007f7aaa9c42d6 in KateView::KateView (this=0x2ce64e0, doc=0x2c80630, parent=<optimized out>) at /usr/src/debug/kate-4.10.5/part/view/kateview.cpp:276
#12 0x00007f7aaa934e49 in KateDocument::createView (this=this@entry=0x2c80630, parent=0x25d1df0) at /usr/src/debug/kate-4.10.5/part/document/katedocument.cpp:292
#13 0x00007f7ab7316d29 in createView (doc=0x2c80630, this=0x25d6da0) at /usr/src/debug/kate-4.10.5/kate/app/kateviewmanager.cpp:396
#14 KateViewManager::createView (this=0x25d6da0, doc=<optimized out>) at /usr/src/debug/kate-4.10.5/kate/app/kateviewmanager.cpp:387
#15 0x00007f7ab7317e88 in KateViewManager::activateView (this=0x25d6da0, d=0x2c80630) at /usr/src/debug/kate-4.10.5/kate/app/kateviewmanager.cpp:617
#16 0x00007f7ab7317f49 in KateViewManager::openUrl (this=0x25d6da0, url=..., encoding=..., activate=true, isTempFile=false, docInfo=...) at /usr/src/debug/kate-4.10.5/kate/app/kateviewmanager.cpp:298
#17 0x00007f7ab72ff979 in KateApp::openDocUrl (this=0x7fff923b1b70, url=..., encoding=..., isTempFile=<optimized out>) at /usr/src/debug/kate-4.10.5/kate/app/kateapp.cpp:345
#18 0x00007f7ab72fc2aa in KateAppAdaptor::tokenOpenUrl (this=0x24f1990, url=..., encoding=..., isTempFile=false) at /usr/src/debug/kate-4.10.5/kate/app/kateappadaptor.cpp:115
#19 0x00007f7ab72fc756 in qt_static_metacall (_a=<optimized out>, _id=<optimized out>, _o=<optimized out>, _c=<optimized out>) at /usr/src/debug/kate-4.10.5/x86_64-redhat-linux-gnu/kate/app/kateappadaptor.moc:106
#20 KateAppAdaptor::qt_static_metacall (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=0x7fff923b0ae0) at /usr/src/debug/kate-4.10.5/x86_64-redhat-linux-gnu/kate/app/kateappadaptor.moc:80
#21 0x00007f7ab72fc91f in KateAppAdaptor::qt_metacall (this=0x24f1990, _c=QMetaObject::InvokeMetaMethod, _id=11, _a=0x7fff923b0ae0) at /usr/src/debug/kate-4.10.5/x86_64-redhat-linux-gnu/kate/app/kateappadaptor.moc:153
#22 0x0000003447a22f83 in QDBusConnectionPrivate::deliverCall (this=this@entry=0x207fdd0, object=object@entry=0x24f1990, msg=..., metaTypes=..., slotIdx=15) at qdbusintegrator.cpp:951
#23 0x0000003447a23fb6 in QDBusConnectionPrivate::activateCall (this=this@entry=0x207fdd0, object=0x24f1990, flags=flags@entry=337, msg=...) at qdbusintegrator.cpp:856
#24 0x0000003447a249f6 in QDBusConnectionPrivate::activateObject (this=0x207fdd0, node=..., msg=..., pathStartPos=<optimized out>) at qdbusintegrator.cpp:1427
#25 0x0000003447a24aeb in QDBusActivateObjectEvent::placeMetaCall (this=0x2c5c070) at qdbusintegrator.cpp:1541
#26 0x000000344718c16e in QObject::event (this=0x7fff923b1b70, e=<optimized out>) at kernel/qobject.cpp:1194
#27 0x0000003e923cc6b4 in QApplication::event (this=0x7fff923b1b70, e=0x2c5c070) at kernel/qapplication.cpp:2544
#28 0x0000003e923ca5ac in QApplicationPrivate::notify_helper (this=this@entry=0x209b790, receiver=receiver@entry=0x7fff923b1b70, e=e@entry=0x2c5c070) at kernel/qapplication.cpp:4562
#29 0x0000003e923cea2a in QApplication::notify (this=0x7fff923b1b70, receiver=0x7fff923b1b70, e=0x2c5c070) at kernel/qapplication.cpp:4423
#30 0x00000039f9c455b6 in KApplication::notify (this=0x7fff923b1b70, receiver=0x7fff923b1b70, event=0x2c5c070) at /usr/src/debug/kdelibs-4.10.5/kdeui/kernel/kapplication.cpp:311
#31 0x000000344717786e in QCoreApplication::notifyInternal (this=0x7fff923b1b70, receiver=receiver@entry=0x7fff923b1b70, event=event@entry=0x2c5c070) at kernel/qcoreapplication.cpp:949
#32 0x000000344717b321 in sendEvent (event=0x2c5c070, receiver=0x7fff923b1b70) at kernel/qcoreapplication.h:231
#33 QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x2060170) at kernel/qcoreapplication.cpp:1573
#34 0x00000034471a5d03 in sendPostedEvents () at kernel/qcoreapplication.h:236
#35 postEventSourceDispatch (s=s@entry=0x2095900) at kernel/qeventdispatcher_glib.cpp:279
#36 0x000000343e047825 in g_main_dispatch (context=0x208e210) at gmain.c:2539
#37 g_main_context_dispatch (context=context@entry=0x208e210) at gmain.c:3075
#38 0x000000343e047b58 in g_main_context_iterate (context=context@entry=0x208e210, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3146
#39 0x000000343e047c14 in g_main_context_iteration (context=0x208e210, may_block=1) at gmain.c:3207
#40 0x00000034471a5e96 in QEventDispatcherGlib::processEvents (this=0x2061ad0, flags=...) at kernel/qeventdispatcher_glib.cpp:424
#41 0x0000003e9246a5ee in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=...) at kernel/qguieventdispatcher_glib.cpp:207
#42 0x000000344717651f in QEventLoop::processEvents (this=this@entry=0x7fff923b1710, flags=...) at kernel/qeventloop.cpp:149
#43 0x00000034471767a8 in QEventLoop::exec (this=0x7fff923b1710, flags=...) at kernel/qeventloop.cpp:204
#44 0x000000344717b638 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1221
#45 0x00007f7ab7559f8d in kdemain (argc=3, argv=<optimized out>) at /usr/src/debug/kate-4.10.5/kate/app/katemain.cpp:382
#46 0x000000343bc21735 in __libc_start_main (main=0x4007d0 <main(int, char**)>, argc=3, ubp_av=0x7fff923b1cf8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fff923b1ce8) at libc-start.c:226
#47 0x0000000000400801 in _start ()

Reported using DrKonqi
Comment 1 Dominik Haumann 2013-08-08 13:11:19 UTC
Can you attach the highlighting file please?
Comment 2 hansoa2 2013-08-08 16:06:24 UTC
(In reply to comment #1)
> Can you attach the highlighting file please?

Change line 18 in /usr/share/kde4/apps/katepart/syntax/cpp.xml to:
      <!-- <!-- <item> asm </item> -->
It didn't crash this time, but C++ disappeared from the list of Sources languages.
(Why does that happen instead of loudly reporting the error?)
Comment 3 Dominik Haumann 2013-08-08 20:37:27 UTC
No, this is invalid XML syntax. We won't introduce support for buggy xml formats. So this is a wont-fix, sorry.

Further info: -- is not allowed in an xml comment, see http://stackoverflow.com/questions/1324821/nested-comments-in-xml
Comment 4 hansoa2 2013-08-08 22:49:47 UTC
Should I create a separate report for "invalid highlight file makes language disappear"?
Comment 5 Dominik Haumann 2013-08-09 07:33:31 UTC
No, the thing is that invalid syntax is simply something we don't have resources for. In this case, the syntax is not valid, and therefore the file is not shown. This is perfectly fine, in fact, what are we supposed to change?

Use the script "checkdtd file.xml" (shipped with Kate, should be installed somewhere on the system) to check validity.