Bug 328271 - Kate crash by segmentation fault while editing
Summary: Kate crash by segmentation fault while editing
Status: RESOLVED DUPLICATE of bug 332426
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: 3.11.2
Platform: Ubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords: drkonqi
: 328885 329023 329384 330176 330196 330350 332288 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-12-01 08:33 UTC by Philippe Sigaud
Modified: 2014-07-09 01:32 UTC (History)
11 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.12.1


Attachments
The file that causes the crash (3.25 KB, text/plain)
2013-12-01 18:13 UTC, Philippe Sigaud
Details
New crash information added by DrKonqi (15.69 KB, text/plain)
2014-05-27 10:45 UTC, Flu87
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Philippe Sigaud 2013-12-01 08:33:46 UTC
Application: kate (3.11.2)
KDE Platform Version: 4.11.2
Qt Version: 4.8.4
Operating System: Linux 3.11.0-13-generic i686
Distribution: Ubuntu 13.10

-- Information about the crash:
- What I was doing when the application crashed:
Editing a small text file, there was a youtube channel on Chromium in the background.
Only this file caused a segmentation fault in Kate. I created as a new file and just entered a few sentences using only ASCII chars. 
Each and everytime I open this file, Kate crashes after a few seconds.
I duplicated the content on another file. No crash for now.

The crash can be reproduced every time.

-- Backtrace:
Application: Kate (kate), signal: Segmentation fault
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".
[Current thread is 1 (Thread 0xb4d2b740 (LWP 2648))]

Thread 3 (Thread 0xb1ce1b40 (LWP 2649)):
#0  0xb76e4424 in __kernel_vsyscall ()
#1  0xb5e8284b in pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_wait.S:187
#2  0xb76089bc in __pthread_cond_wait (cond=0xb221e8d0, mutex=0xb221e8b8) at forward.c:149
#3  0xb211bef2 in ?? () from /usr/lib/i386-linux-gnu/libQtScript.so.4
#4  0xb211bf3f in ?? () from /usr/lib/i386-linux-gnu/libQtScript.so.4
#5  0xb5e7ed78 in start_thread (arg=0xb1ce1b40) at pthread_create.c:311
#6  0xb75fb01e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:131

Thread 2 (Thread 0xaee3bb40 (LWP 2700)):
#0  0xb76e4424 in __kernel_vsyscall ()
#1  0xb75eba0b in poll () at ../sysdeps/unix/syscall-template.S:81
#2  0xb5daea4b in g_poll () from /lib/i386-linux-gnu/libglib-2.0.so.0
#3  0xb5d9fb68 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
#4  0xb5d9fca8 in g_main_context_iteration () from /lib/i386-linux-gnu/libglib-2.0.so.0
#5  0xb615b8df in QEventDispatcherGlib::processEvents (this=0xae500468, flags=...) at kernel/qeventdispatcher_glib.cpp:426
#6  0xb612a9f3 in QEventLoop::processEvents (this=this@entry=0xaee3b228, flags=...) at kernel/qeventloop.cpp:149
#7  0xb612ad19 in QEventLoop::exec (this=this@entry=0xaee3b228, flags=...) at kernel/qeventloop.cpp:204
#8  0xb6019e3d in QThread::exec (this=this@entry=0xa15d480) at thread/qthread.cpp:542
#9  0xb610ae14 in QInotifyFileSystemWatcherEngine::run (this=0xa15d480) at io/qfilesystemwatcher_inotify.cpp:265
#10 0xb601c72f in QThreadPrivate::start (arg=0xa15d480) at thread/qthread_unix.cpp:338
#11 0xb5e7ed78 in start_thread (arg=0xaee3bb40) at pthread_create.c:311
#12 0xb75fb01e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:131

Thread 1 (Thread 0xb4d2b740 (LWP 2648)):
[KCrash Handler]
#7  0xb232c828 in contextNum (n=<optimized out>, this=<optimized out>) at ../../part/syntax/katehighlight.h:267
#8  KateDocument::defStyleNum (this=0x9cf6438, line=line@entry=126, column=column@entry=14) at ../../part/document/katedocument.cpp:5376
#9  0xb2357c1e in KateScriptDocument::defStyleNum (this=this@entry=0xa133b18, line=line@entry=126, column=column@entry=14) at ../../part/script/katescriptdocument.cpp:51
#10 0xb2357d3b in KateScriptDocument::isString (this=this@entry=0xa133b18, line=126, column=column@entry=14) at ../../part/script/katescriptdocument.cpp:83
#11 0xb2357d8b in KateScriptDocument::isString (this=this@entry=0xa133b18, cursor=...) at ../../part/script/katescriptdocument.cpp:89
#12 0xb22c7cfe in KateScriptDocument::qt_static_metacall (_o=_o@entry=0xa133b18, _id=_id@entry=91, _a=_a@entry=0xbfc67b9c, _c=QMetaObject::InvokeMetaMethod) at moc_katescriptdocument.cpp:408
#13 0xb22c9043 in qt_static_metacall (_a=0xbfc67b9c, _id=91, _c=QMetaObject::InvokeMetaMethod, _o=0xa133b18) at moc_katescriptdocument.cpp:467
#14 KateScriptDocument::qt_metacall (this=0xa133b18, _c=QMetaObject::InvokeMetaMethod, _id=91, _a=0xbfc67b9c) at moc_katescriptdocument.cpp:468
#15 0xb6132e35 in QMetaObject::metacall (object=0xa133b18, cl=QMetaObject::InvokeMetaMethod, idx=95, argv=0xbfc67b9c) at kernel/qmetaobject.cpp:245
#16 0xb218de94 in ?? () from /usr/lib/i386-linux-gnu/libQtScript.so.4
#17 0xb218f434 in ?? () from /usr/lib/i386-linux-gnu/libQtScript.so.4
#18 0xb218f72e in ?? () from /usr/lib/i386-linux-gnu/libQtScript.so.4
#19 0xb20833c3 in ?? () from /usr/lib/i386-linux-gnu/libQtScript.so.4
#20 0xb205e4bc in ?? () from /usr/lib/i386-linux-gnu/libQtScript.so.4
#21 0xaee91a1c in ?? ()
#22 0xb2019ac2 in ?? () from /usr/lib/i386-linux-gnu/libQtScript.so.4
#23 0xb20b1366 in ?? () from /usr/lib/i386-linux-gnu/libQtScript.so.4
#24 0xb2083427 in ?? () from /usr/lib/i386-linux-gnu/libQtScript.so.4
#25 0xb2179b4a in QScriptValue::call(QScriptValue const&, QList<QScriptValue> const&) () from /usr/lib/i386-linux-gnu/libQtScript.so.4
#26 0xb234ebef in KateIndentScript::indent (this=0x9ce3c48, view=view@entry=0x9f2a2c0, position=..., typedCharacter=typedCharacter@entry=..., indentWidth=4) at ../../part/script/kateindentscript.cpp:73
#27 0xb244ab4d in KateAutoIndent::scriptIndent (this=this@entry=0x9bd8ac8, view=view@entry=0x9f2a2c0, position=..., typedChar=typedChar@entry=...) at ../../part/utils/kateautoindent.cpp:268
#28 0xb244ad1d in KateAutoIndent::userTypedChar (this=0x9bd8ac8, view=0x9f2a2c0, position=..., typedChar=...) at ../../part/utils/kateautoindent.cpp:459
#29 0xb233b110 in KateDocument::typeChars (this=0x9cf6438, view=0x9f2a2c0, realChars=...) at ../../part/document/katedocument.cpp:2603
#30 0xb23c444c in KateViewInternal::keyPressEvent (this=0x9f300a8, e=0xbfc68548) at ../../part/view/kateviewinternal.cpp:2384
#31 0xb23c2f32 in KateViewInternal::eventFilter (this=0x9f300a8, obj=0x9f300a8, e=0xbfc68548) at ../../part/view/kateviewinternal.cpp:2186
#32 0xb612c04e in QCoreApplicationPrivate::sendThroughObjectEventFilters (this=this@entry=0x9ae8e78, receiver=receiver@entry=0x9f300a8, event=event@entry=0xbfc68548) at kernel/qcoreapplication.cpp:1056
#33 0xb6b8f721 in QApplicationPrivate::notify_helper (this=0x9ae8e78, receiver=0x9f300a8, e=0xbfc68548) at kernel/qapplication.cpp:4563
#34 0xb6b97abc in QApplication::notify (this=0xbfc68cbc, receiver=<optimized out>, receiver@entry=0x9f300a8, e=e@entry=0xbfc68548) at kernel/qapplication.cpp:4008
#35 0xb64ecff4 in KApplication::notify (this=0xbfc68cbc, receiver=0x9f300a8, event=0xbfc68548) at ../../kdeui/kernel/kapplication.cpp:311
#36 0xb612beda in QCoreApplication::notifyInternal (this=0xbfc68cbc, receiver=receiver@entry=0x9f300a8, event=event@entry=0xbfc68548) at kernel/qcoreapplication.cpp:946
#37 0xb6b8dbcd in sendSpontaneousEvent (event=0xbfc68548, receiver=0x9f300a8) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:234
#38 qt_sendSpontaneousEvent (receiver=0x9f300a8, event=event@entry=0xbfc68548) at kernel/qapplication.cpp:5565
#39 0xb6c41579 in QKeyMapper::sendKeyEvent (keyWidget=keyWidget@entry=0x9f300a8, grab=grab@entry=false, type=QEvent::KeyPress, code=60, modifiers=..., text=..., autorepeat=autorepeat@entry=false, count=1, nativeScanCode=nativeScanCode@entry=94, nativeVirtualKey=60, nativeModifiers=nativeModifiers@entry=0) at kernel/qkeymapper_x11.cpp:1866
#40 0xb6c41968 in QKeyMapperPrivate::translateKeyEvent (this=0x9b1f418, keyWidget=keyWidget@entry=0x9f300a8, event=event@entry=0xbfc688bc, grab=grab@entry=false) at kernel/qkeymapper_x11.cpp:1836
#41 0xb6c17ae5 in QApplication::x11ProcessEvent (this=0xbfc68cbc, event=event@entry=0xbfc688bc) at kernel/qapplication_x11.cpp:3639
#42 0xb6c44274 in x11EventSourceDispatch (s=0x9ab6680, callback=0x0, user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:146
#43 0xb5d9f83e in g_main_context_dispatch () from /lib/i386-linux-gnu/libglib-2.0.so.0
#44 0xb5d9fbe8 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
#45 0xb5d9fca8 in g_main_context_iteration () from /lib/i386-linux-gnu/libglib-2.0.so.0
#46 0xb615b8df in QEventDispatcherGlib::processEvents (this=this@entry=0x9ae6a10, flags=...) at kernel/qeventdispatcher_glib.cpp:426
#47 0xb6c4432e in QGuiEventDispatcherGlib::processEvents (this=0x9ae6a10, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#48 0xb612a9f3 in QEventLoop::processEvents (this=this@entry=0xbfc68b78, flags=...) at kernel/qeventloop.cpp:149
#49 0xb612ad19 in QEventLoop::exec (this=this@entry=0xbfc68b78, flags=...) at kernel/qeventloop.cpp:204
#50 0xb613089e in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1218
#51 0xb6b8d974 in QApplication::exec () at kernel/qapplication.cpp:3828
#52 0xb76dd86d in kdemain (argc=2, argv=0xbfc68dc4) at ../../../kate/app/katemain.cpp:380
#53 0x0804854b in main (argc=2, argv=0xbfc68dc4) at kate_dummy.cpp:3

Reported using DrKonqi
Comment 1 Dominik Haumann 2013-12-01 12:17:48 UTC
Can you please attach the file that leads to the crash?
Comment 2 Philippe Sigaud 2013-12-01 18:13:13 UTC
Created attachment 83862 [details]
The file that causes the crash
Comment 3 Philippe Sigaud 2013-12-01 18:15:42 UTC
(In reply to comment #1)
> Can you please attach the file that leads to the crash?

Here it is. I should have thought you might want it.
Comment 4 Dominik Haumann 2013-12-01 19:08:59 UTC
Hm, I cannot reproduce :/ anyone else?

@Philippe: Can you please follow http://kate-editor.org/get-it/ and build Kate from sources and tell us whether the problem persists? And if it still crashes, please paste another backtrace.
Comment 5 Philippe Sigaud 2013-12-01 21:00:57 UTC
On my original version of Kate, it crashes on line 127 on the attached
file (when closing the <bar part, or typing anything afterwards).

I just built kate following the instructions on the page. (still
3.11.2 in the About menu, but the copyright is now 2000-2013 instead
of 2000-2005 on my Kubuntu 13.10 version, so I guess it worked and I'm
indeed running the head version).


I'm afraid it still segfaults :( Still at line 127, after`<bar`, when typing `<`

Here is the backtrace:


Application: Kate (kate), signal: Segmentation fault

Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".

[Current thread is 1 (Thread 0xb4e1f980 (LWP 21359))]


Thread 3 (Thread 0xb1d55b40 (LWP 21360)):

#0 0xb77be424 in __kernel_vsyscall ()

#1 0xb5f5a84b in pthread_cond_wait@@GLIBC_2.3.2 () at
../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_wait.S:187

#2 0xb76e09bc in __pthread_cond_wait (cond=0xb22e58d0,
mutex=0xb22e58b8) at forward.c:149

#3 0xb21e2ef2 in ?? () from /usr/lib/i386-linux-gnu/libQtScript.so.4

#4 0xb21e2f3f in ?? () from /usr/lib/i386-linux-gnu/libQtScript.so.4

#5 0xb5f56d78 in start_thread (arg=0xb1d55b40) at pthread_create.c:311

#6 0xb76d301e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:131


Thread 2 (Thread 0xaeebbb40 (LWP 21411)):

#0 0xb77be424 in __kernel_vsyscall ()

#1 0xb76e64d2 in clock_gettime (clock_id=1, tp=0xaeebafc8) at
../sysdeps/unix/clock_gettime.c:115

#2 0xb614f3ec in do_gettime (frac=0xaeebafc0, sec=0xaeebafb8) at
tools/qelapsedtimer_unix.cpp:123

#3 qt_gettime () at tools/qelapsedtimer_unix.cpp:140

#4 0xb6234fd2 in updateCurrentTime (this=0xae502074) at
kernel/qeventdispatcher_unix.cpp:354

#5 QTimerInfoList::timerWait (this=0xae502074, tm=...) at
kernel/qeventdispatcher_unix.cpp:461

#6 0xb623367b in timerSourcePrepareHelper (src=<optimized out>,
timeout=0xaeebb0bc) at kernel/qeventdispatcher_glib.cpp:136

#7 0xb623370d in timerSourcePrepare (source=0xae502040,
timeout=0xaeebb0bc) at kernel/qeventdispatcher_glib.cpp:169

#8 0xb5e77143 in g_main_context_prepare () from
/lib/i386-linux-gnu/libglib-2.0.so.0

#9 0xb5e77a5f in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0

#10 0xb5e77ca8 in g_main_context_iteration () from
/lib/i386-linux-gnu/libglib-2.0.so.0

#11 0xb62338df in QEventDispatcherGlib::processEvents
(this=0xae500468, flags=...) at kernel/qeventdispatcher_glib.cpp:426

#12 0xb62029f3 in QEventLoop::processEvents
(this=this@entry=0xaeebb228, flags=...) at kernel/qeventloop.cpp:149

#13 0xb6202d19 in QEventLoop::exec (this=this@entry=0xaeebb228,
flags=...) at kernel/qeventloop.cpp:204

#14 0xb60f1e3d in QThread::exec (this=this@entry=0x9c7bb00) at
thread/qthread.cpp:542

#15 0xb61e2e14 in QInotifyFileSystemWatcherEngine::run
(this=0x9c7bb00) at io/qfilesystemwatcher_inotify.cpp:265

#16 0xb60f472f in QThreadPrivate::start (arg=0x9c7bb00) at
thread/qthread_unix.cpp:338

#17 0xb5f56d78 in start_thread (arg=0xaeebbb40) at pthread_create.c:311

#18 0xb76d301e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:131


Thread 1 (Thread 0xb4e1f980 (LWP 21359)):

[KCrash Handler]

#7 0xb241cc44 in KSharedPtr (o=..., this=<synthetic pointer>) at
/usr/include/ksharedptr.h:84

#8 KateDocument::defStyleNum (this=0x9aa9b30, line=line@entry=126,
column=column@entry=9) at
/home/philippe/kde/kate/part/document/katedocument.cpp:5485

#9 0xb244875e in KateScriptDocument::defStyleNum
(this=this@entry=0xa157cb8, line=line@entry=126,
column=column@entry=9) at
/home/philippe/kde/kate/part/script/katescriptdocument.cpp:51

#10 0xb244887b in KateScriptDocument::isString
(this=this@entry=0xa157cb8, line=126, column=column@entry=9) at
/home/philippe/kde/kate/part/script/katescriptdocument.cpp:83

#11 0xb24488cb in KateScriptDocument::isString
(this=this@entry=0xa157cb8, cursor=...) at
/home/philippe/kde/kate/part/script/katescriptdocument.cpp:89

#12 0xb23b779e in KateScriptDocument::qt_static_metacall
(_o=_o@entry=0xa157cb8, _id=_id@entry=91, _a=_a@entry=0xbfc4985c,
_c=QMetaObject::InvokeMetaMethod) at
/home/philippe/kde/kate/build/part/moc_katescriptdocument.cpp:408

#13 0xb23b8ae3 in qt_static_metacall (_a=0xbfc4985c, _id=91,
_c=QMetaObject::InvokeMetaMethod, _o=0xa157cb8) at
/home/philippe/kde/kate/build/part/moc_katescriptdocument.cpp:467

#14 KateScriptDocument::qt_metacall (this=0xa157cb8,
_c=QMetaObject::InvokeMetaMethod, _id=91, _a=0xbfc4985c) at
/home/philippe/kde/kate/build/part/moc_katescriptdocument.cpp:468

#15 0xb620ae35 in QMetaObject::metacall (object=0xa157cb8,
cl=QMetaObject::InvokeMetaMethod, idx=95, argv=0xbfc4985c) at
kernel/qmetaobject.cpp:245

#16 0xb2254e94 in ?? () from /usr/lib/i386-linux-gnu/libQtScript.so.4

#17 0xb2256434 in ?? () from /usr/lib/i386-linux-gnu/libQtScript.so.4

#18 0xb225672e in ?? () from /usr/lib/i386-linux-gnu/libQtScript.so.4

#19 0xb214a3c3 in ?? () from /usr/lib/i386-linux-gnu/libQtScript.so.4

#20 0xb21254bc in ?? () from /usr/lib/i386-linux-gnu/libQtScript.so.4

#21 0xaf561d35 in ?? ()

#22 0xb20e0ac2 in ?? () from /usr/lib/i386-linux-gnu/libQtScript.so.4

#23 0xb2178366 in ?? () from /usr/lib/i386-linux-gnu/libQtScript.so.4

#24 0xb214a427 in ?? () from /usr/lib/i386-linux-gnu/libQtScript.so.4

#25 0xb2240b4a in QScriptValue::call(QScriptValue const&,
QList<QScriptValue> const&) () from
/usr/lib/i386-linux-gnu/libQtScript.so.4

#26 0xb243f72f in KateIndentScript::indent (this=0x98b1118,
view=view@entry=0x9cdf040, position=...,
typedCharacter=typedCharacter@entry=..., indentWidth=4) at
/home/philippe/kde/kate/part/script/kateindentscript.cpp:73

#27 0xb254d30d in KateAutoIndent::scriptIndent
(this=this@entry=0x993aff8, view=view@entry=0x9cdf040, position=...,
typedChar=typedChar@entry=...) at
/home/philippe/kde/kate/part/utils/kateautoindent.cpp:268

#28 0xb254d4dd in KateAutoIndent::userTypedChar (this=0x993aff8,
view=0x9cdf040, position=..., typedChar=...) at
/home/philippe/kde/kate/part/utils/kateautoindent.cpp:459

#29 0xb242b71b in KateDocument::typeChars (this=0x9aa9b30,
view=0x9cdf040, realChars=...) at
/home/philippe/kde/kate/part/document/katedocument.cpp:2653

#30 0xb24b6204 in KateViewInternal::keyPressEvent (this=0x9cf21f8,
e=0xbfc4a208) at
/home/philippe/kde/kate/part/view/kateviewinternal.cpp:2426

#31 0xb24b4cd2 in KateViewInternal::eventFilter (this=0x9cf21f8,
obj=0x9cf21f8, e=0xbfc4a208) at
/home/philippe/kde/kate/part/view/kateviewinternal.cpp:2227

#32 0xb620404e in
QCoreApplicationPrivate::sendThroughObjectEventFilters
(this=this@entry=0x9843d18, receiver=receiver@entry=0x9cf21f8,
event=event@entry=0xbfc4a208) at kernel/qcoreapplication.cpp:1056

#33 0xb6c67721 in QApplicationPrivate::notify_helper (this=0x9843d18,
receiver=0x9cf21f8, e=0xbfc4a208) at kernel/qapplication.cpp:4563

#34 0xb6c6fabc in QApplication::notify (this=0xbfc4a97c,
receiver=<optimized out>, receiver@entry=0x9cf21f8,
e=e@entry=0xbfc4a208) at kernel/qapplication.cpp:4008

#35 0xb65c4ff4 in KApplication::notify (this=0xbfc4a97c,
receiver=0x9cf21f8, event=0xbfc4a208) at
../../kdeui/kernel/kapplication.cpp:311

#36 0xb6203eda in QCoreApplication::notifyInternal (this=0xbfc4a97c,
receiver=receiver@entry=0x9cf21f8, event=event@entry=0xbfc4a208) at
kernel/qcoreapplication.cpp:946

#37 0xb6c65bcd in sendSpontaneousEvent (event=0xbfc4a208,
receiver=0x9cf21f8) at
../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:234

#38 qt_sendSpontaneousEvent (receiver=0x9cf21f8,
event=event@entry=0xbfc4a208) at kernel/qapplication.cpp:5565

#39 0xb6d19579 in QKeyMapper::sendKeyEvent
(keyWidget=keyWidget@entry=0x9cf21f8, grab=grab@entry=false,
type=QEvent::KeyPress, code=62, modifiers=..., text=...,
autorepeat=autorepeat@entry=false, count=1,
nativeScanCode=nativeScanCode@entry=94, nativeVirtualKey=62,
nativeModifiers=nativeModifiers@entry=17) at
kernel/qkeymapper_x11.cpp:1866

#40 0xb6d19968 in QKeyMapperPrivate::translateKeyEvent
(this=0x987fbd0, keyWidget=keyWidget@entry=0x9cf21f8,
event=event@entry=0xbfc4a57c, grab=grab@entry=false) at
kernel/qkeymapper_x11.cpp:1836

#41 0xb6cefae5 in QApplication::x11ProcessEvent (this=0xbfc4a97c,
event=event@entry=0xbfc4a57c) at kernel/qapplication_x11.cpp:3639

#42 0xb6d1c274 in x11EventSourceDispatch (s=0x9844f58, callback=0x0,
user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:146

#43 0xb5e7783e in g_main_context_dispatch () from
/lib/i386-linux-gnu/libglib-2.0.so.0

#44 0xb5e77be8 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0

#45 0xb5e77ca8 in g_main_context_iteration () from
/lib/i386-linux-gnu/libglib-2.0.so.0

#46 0xb62338bf in QEventDispatcherGlib::processEvents
(this=this@entry=0x984a130, flags=...) at
kernel/qeventdispatcher_glib.cpp:424

#47 0xb6d1c32e in QGuiEventDispatcherGlib::processEvents
(this=0x984a130, flags=...) at kernel/qguieventdispatcher_glib.cpp:204

#48 0xb62029f3 in QEventLoop::processEvents
(this=this@entry=0xbfc4a838, flags=...) at kernel/qeventloop.cpp:149

#49 0xb6202d19 in QEventLoop::exec (this=this@entry=0xbfc4a838,
flags=...) at kernel/qeventloop.cpp:204

#50 0xb620889e in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1218

#51 0xb6c65974 in QApplication::exec () at kernel/qapplication.cpp:3828

#52 0xb77b785d in kdemain (argc=1, argv=0xbfc4aa84) at
/home/philippe/kde/kate/kate/app/katemain.cpp:380

#53 0x0804853b in main (argc=1, argv=0xbfc4aa84) at
/home/philippe/kde/kate/build/kate/app/kate_dummy.cpp:3
Comment 6 Michal Humpula 2013-12-09 23:11:56 UTC
Hi Philippe,

what highlight are you using? Will it crash, when you use different highlight, for example "None"?
Comment 7 Philippe Sigaud 2013-12-10 05:54:49 UTC
> what highlight are you using? Will it crash, when you use different highlight,
> for example "None"?

No crash with no highlighting.
Damn, I just spend 10 minutes trying to make the segfault appear
again, to no avail.

If I don't get it anymore, what should I do, close the bug report?
Comment 8 Michal Humpula 2013-12-10 09:04:48 UTC
No, you were obviously hitting a bug. We just can't reproduce it. It might come from the highlighting system. That's why I was asking about highlighting you were using, when the crash appeared, so we can simulate the same conditions.
Comment 9 Dominik Haumann 2013-12-17 12:20:18 UTC
*** Bug 328885 has been marked as a duplicate of this bug. ***
Comment 10 Dominik Haumann 2013-12-17 12:22:58 UTC
@Philippe: Which indenter do you use?

I'm not sure what's going on here. If we knew the input was wrong in e.g. KateScriptDocument::isString() or KateScriptDocument::defStyleNum() we maybe could fix it.
Comment 11 Philippe Sigaud 2013-12-17 12:45:50 UTC
> @Philippe: Which indenter do you use?
>
> I'm not sure what's going on here. If we knew the input was wrong in e.g.
> KateScriptDocument::isString() or KateScriptDocument::defStyleNum() we maybe
> could fix it.

I used the default indenter style.
Comment 12 Dominik Haumann 2013-12-17 12:53:27 UTC
But the "default" indenter should never invoke isString()... Are you sure? What do you mean by default?
Comment 13 Philippe Sigaud 2013-12-17 13:37:03 UTC
I mean 'none' or something like that. Since I was editing a Markdown
file, I did not need any specific indentation. Sorry not to remember,
but that was two weeks ago, on a specific file.

Otherwise, I use the C/C++ option IIRC.

I don't have access to my own machine right now, I'll have a look in a
few hours.
Comment 14 Jonas Oberhauser 2013-12-17 14:40:21 UTC
Btw, there is no crash if I copy paste the symbol or if it is inserted automatically, e.g., by opening curly braces (the editor closes it with };).
Comment 15 Philippe Sigaud 2013-12-17 18:22:51 UTC
> I don't have access to my own machine right now, I'll have a look in a
> few hours.

I used either 'none' or 'normal'. As I said, I cannot reproduce the crash now.
Comment 16 Dominik Haumann 2013-12-21 14:34:17 UTC
*** Bug 329023 has been marked as a duplicate of this bug. ***
Comment 17 Dominik Haumann 2013-12-21 14:46:11 UTC
@Michal:

katehighlight.h:
  KateHlContext *contextNum (int n)
  {
    if (n >= 0 && n < m_contexts.size()) return m_contexts[n];
    Q_ASSERT (0);
    return m_contexts[0];
   }

With your patch, instead of passing the contents of the last item of contextStack() to contextNum, we now pass the size()-1 of the contextStack() to contextNum. I don't think that makes sense, does it?

(In release mode, it's optimized out, so we access m_contexts[0] even though there are no elements. This should be a return 0 anyways, as now re return an arbitrary value that does not really exist.

My guess is another one:
#7 0xb241cc44 in KSharedPtr (o=..., this=...) at /usr/include/ksharedptr.h:84
#8 KateDocument::defStyleNum (this=0x9aa9b30, line=126, column=9) at part/document/katedocument.cpp:5485

Kate::TextLine is a shared pointer. And this is most probably invalid. Therefore, I'd propose to just do a validity check as we have it almost everywhere in the code:
  if( !tl )
    return -1;

Will commit this, let's see whether this changes anything for the 4.12.1 release.
Comment 18 Saurav Sengupta 2013-12-21 14:52:38 UTC
(In reply to comment #16)
> *** Bug 329023 has been marked as a duplicate of this bug. ***

1. I always experience the crash even when highlighting is set to 'None', in contrast to what has been reported here.
2. In my case Kate or any other editor does not crash "after a few seconds" as posted in the original report, they crash at once when typing a colon symbol.
3. I experience the crash only in plain text files not containing any programming language source code or other markup. In source code/markup files I actually do not get any crash.
Comment 19 Dominik Haumann 2013-12-21 15:06:13 UTC
1. Can you provide a valgrind trace?

valgrind kwrite # or kate, then attache the output here

ThereWhat I don't understand is: If you have no indenter set (none or normal), no script indenter is used. However, the backtrace clearly says that a scripted indenter is active that finally calls KateScriptDocument::isString(). This indicates that the indenter is different from none or normal. Maybe it's C++/Boost style?

I'll attach a possible patch, but I'm not sure it rather fixes the blame than the source of the problem.
Comment 20 Dominik Haumann 2013-12-21 15:19:56 UTC
Potential fix: https://git.reviewboard.kde.org/r/114586/
Comment 21 Saurav Sengupta 2013-12-21 15:21:40 UTC
@Dominik: Whom were you addressing in comment 19?
Comment 22 Dominik Haumann 2013-12-21 16:59:46 UTC
Git commit 52faa15fdae2479a727daad6b4aab28606c963da by Dominik Haumann.
Committed on 21/12/2013 at 16:58.
Pushed by dhaumann into branch 'master'.

fix crashes in KateDocument::defStyleNum() by adding if-guards.
REVIEW: 114586
FIXED-IN: 4.12.1

M  +35   -28   part/document/katedocument.cpp

http://commits.kde.org/kate/52faa15fdae2479a727daad6b4aab28606c963da
Comment 23 Dominik Haumann 2013-12-21 17:00:17 UTC
Git commit d992a1905baf704d1040d2e63cce4f1d937cdf5e by Dominik Haumann.
Committed on 21/12/2013 at 16:58.
Pushed by dhaumann into branch 'KDE/4.12'.

fix crashes in KateDocument::defStyleNum() by adding if-guards.
REVIEW: 114586
FIXED-IN: 4.12.1

M  +35   -28   part/document/katedocument.cpp

http://commits.kde.org/kate/d992a1905baf704d1040d2e63cce4f1d937cdf5e
Comment 24 Jekyll Wu 2013-12-30 03:57:26 UTC
*** Bug 329384 has been marked as a duplicate of this bug. ***
Comment 25 Jekyll Wu 2014-01-20 02:07:02 UTC
*** Bug 330176 has been marked as a duplicate of this bug. ***
Comment 26 Jekyll Wu 2014-01-20 13:20:37 UTC
*** Bug 330196 has been marked as a duplicate of this bug. ***
Comment 27 Jekyll Wu 2014-01-24 07:30:57 UTC
*** Bug 330350 has been marked as a duplicate of this bug. ***
Comment 28 Jekyll Wu 2014-03-18 21:19:41 UTC
*** Bug 332288 has been marked as a duplicate of this bug. ***
Comment 29 Jekyll Wu 2014-03-22 06:36:12 UTC
*** Bug 332426 has been marked as a duplicate of this bug. ***
Comment 30 Jekyll Wu 2014-05-03 01:05:56 UTC
*** Bug 334248 has been marked as a duplicate of this bug. ***
Comment 31 Flu87 2014-05-27 10:45:45 UTC
Created attachment 86857 [details]
New crash information added by DrKonqi

kdevelop (4.5.2) on KDE Platform 4.12.5 using Qt 4.8.5

- What I was doing when the application crashed:
create new document (not saving it)
type a :
crash

-- Backtrace (Reduced):
#6  KateDocument::defStyleNum (this=0x7f49770, line=<optimized out>, column=5) at /var/tmp/portage/kde-base/katepart-4.12.5/work/katepart-4.12.5/part/document/katedocument.cpp:5472
#7  0x00007f1882d40d69 in KateScriptDocument::defStyleNum (this=<optimized out>, line=<optimized out>, column=<optimized out>) at /var/tmp/portage/kde-base/katepart-4.12.5/work/katepart-4.12.5/part/script/katescriptdocument.cpp:51
#8  0x00007f1882d40e29 in KateScriptDocument::isString (this=<optimized out>, line=<optimized out>, column=<optimized out>) at /var/tmp/portage/kde-base/katepart-4.12.5/work/katepart-4.12.5/part/script/katescriptdocument.cpp:83
#9  0x00007f1882caaed6 in KateScriptDocument::qt_static_metacall (_o=0x80a57e0, _id=-1550264016, _a=0x7fff64da9940, _c=<optimized out>) at /var/tmp/portage/kde-base/katepart-4.12.5/work/katepart-4.12.5_build/part/moc_katescriptdocument.cpp:407
#10 0x00007f1882cac141 in KateScriptDocument::qt_metacall (this=0x80a57e0, _c=QMetaObject::InvokeMetaMethod, _id=<optimized out>, _a=0x7fff64da9940) at /var/tmp/portage/kde-base/katepart-4.12.5/work/katepart-4.12.5_build/part/moc_katescriptdocument.cpp:471
Comment 32 Dominik Haumann 2014-06-04 11:04:32 UTC
The true fix was commit for bug #332426 only for KDE 4.14 only 3 weeks ago.

*** This bug has been marked as a duplicate of bug 332426 ***
Comment 33 Jekyll Wu 2014-07-09 01:32:22 UTC
*** Bug 337229 has been marked as a duplicate of this bug. ***