Bug 339627 - vi input mode: Kate 3.14.1 (kubuntu 4.14.1 backport) crashes when saving files
Summary: vi input mode: Kate 3.14.1 (kubuntu 4.14.1 backport) crashes when saving files
Status: RESOLVED FIXED
Alias: None
Product: frameworks-ktexteditor
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Kubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-03 09:12 UTC by Stephan Lahl
Modified: 2017-07-24 21:33 UTC (History)
3 users (show)

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


Attachments
gdb stacktrace (28.94 KB, text/plain)
2015-03-10 09:20 UTC, Boris Egorov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Lahl 2014-10-03 09:12:36 UTC
Application: kate (3.14.1)
KDE Platform Version: 4.14.1
Qt Version: 4.8.6
Operating System: Linux 3.13.0-36-generic x86_64
Distribution: Ubuntu 14.04.1 LTS

-- Information about the crash:
- What I was doing when the application crashed:

Pasted text from clipboard/xselection (they are synchronized here).
:wq (save and quit)
-> Crash.

Custom setting: vi-mode.
Didn't happen before I upgraded to kde 4.14.1 via kubuntu backports.
(System is Ubunty 14.04 LTS Trusty Tahr)

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

Thread 4 (Thread 0x7f25dd3b5700 (LWP 20342)):
#0  0x00007f25f8c0862a in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#1  0x00007f25f8c08989 in g_mutex_lock () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f25f8bc6699 in g_main_context_prepare () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f25f8bc6f03 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007f25f8bc70ec in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007f25f99a67be in QEventDispatcherGlib::processEvents (this=0x7f25d80008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:436
#6  0x00007f25f99780af in QEventLoop::processEvents (this=this@entry=0x7f25dd3b4de0, flags=...) at kernel/qeventloop.cpp:149
#7  0x00007f25f99783a5 in QEventLoop::exec (this=this@entry=0x7f25dd3b4de0, flags=...) at kernel/qeventloop.cpp:204
#8  0x00007f25f9874c5f in QThread::exec (this=this@entry=0x174ccf0) at thread/qthread.cpp:537
#9  0x00007f25f9959823 in QInotifyFileSystemWatcherEngine::run (this=0x174ccf0) at io/qfilesystemwatcher_inotify.cpp:265
#10 0x00007f25f987732f in QThreadPrivate::start (arg=0x174ccf0) at thread/qthread_unix.cpp:349
#11 0x00007f25f90a6182 in start_thread (arg=0x7f25dd3b5700) at pthread_create.c:312
#12 0x00007f25fba95fbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 3 (Thread 0x7f25dcb28700 (LWP 20343)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007f25e8f24ffb in ?? () from /usr/lib/x86_64-linux-gnu/libQtScript.so.4
#2  0x00007f25e8f25039 in ?? () from /usr/lib/x86_64-linux-gnu/libQtScript.so.4
#3  0x00007f25f90a6182 in start_thread (arg=0x7f25dcb28700) at pthread_create.c:312
#4  0x00007f25fba95fbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 2 (Thread 0x7f25555f8700 (LWP 20348)):
#0  0x00007f25f8bec3a0 in g_thread_self () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#1  0x00007f25f8bc70dd in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f25f99a67be in QEventDispatcherGlib::processEvents (this=0x7f25480008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:436
#3  0x00007f25f99780af in QEventLoop::processEvents (this=this@entry=0x7f25555f7de0, flags=...) at kernel/qeventloop.cpp:149
#4  0x00007f25f99783a5 in QEventLoop::exec (this=this@entry=0x7f25555f7de0, flags=...) at kernel/qeventloop.cpp:204
#5  0x00007f25f9874c5f in QThread::exec (this=this@entry=0x1bacd60) at thread/qthread.cpp:537
#6  0x00007f25f9959823 in QInotifyFileSystemWatcherEngine::run (this=0x1bacd60) at io/qfilesystemwatcher_inotify.cpp:265
#7  0x00007f25f987732f in QThreadPrivate::start (arg=0x1bacd60) at thread/qthread_unix.cpp:349
#8  0x00007f25f90a6182 in start_thread (arg=0x7f25555f8700) at pthread_create.c:312
#9  0x00007f25fba95fbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 1 (Thread 0x7f25fc1337c0 (LWP 20340)):
[KCrash Handler]
#5  0x000000000000006a in ?? ()
#6  0x00007f25faf2b090 in QApplication::x11ProcessEvent (this=0x7fff347d4900, event=event@entry=0x7fff347d42f0) at kernel/qapplication_x11.cpp:3529
#7  0x00007f25faf53b02 in x11EventSourceDispatch (s=0x1132d40, callback=0x0, user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:146
#8  0x00007f25f8bc6e04 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#9  0x00007f25f8bc7048 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#10 0x00007f25f8bc70ec in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#11 0x00007f25f99a67a1 in QEventDispatcherGlib::processEvents (this=0x10ea500, flags=...) at kernel/qeventdispatcher_glib.cpp:434
#12 0x00007f25faf53bb6 in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#13 0x00007f25f99780af in QEventLoop::processEvents (this=this@entry=0x7fff347d46c0, flags=...) at kernel/qeventloop.cpp:149
#14 0x00007f25f99783a5 in QEventLoop::exec (this=this@entry=0x7fff347d46c0, flags=...) at kernel/qeventloop.cpp:204
#15 0x00007f25f997db79 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1225
#16 0x00007f25fbd67d15 in kdemain () from /usr/lib/kde4/libkdeinit/libkdeinit4_kate.so
#17 0x00007f25fb9bcec5 in __libc_start_main (main=0x4006d0, argc=3, argv=0x7fff347d4a88, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fff347d4a78) at libc-start.c:287
#18 0x00000000004006fe in _start ()

The reporter indicates this bug may be a duplicate of or related to bug 335065.

Possible duplicates by query: bug 339285, bug 339046, bug 336970, bug 336966, bug 336922.

An https://bugs.kde.org/ berichten
Comment 1 Radics Péter 2015-03-09 10:17:57 UTC
Happens on arch-linux, too with kate version 5.0.0.

Actually , the segfault happens right after typing :w (before even typing q or <ENTER>):

---------------------------
katepart: Register  '-'  set to  "=10"
katepart: Register  "  set to point to " '-'
katepart: Register  '^'  set to  ""
katepart: Command already registered:  "s" . Aborting.
katepart:        ":"
katepart:        "w"
katepart: New text:  "w"
Segmentation fault (core dumped)
---------------------------

Similar segfault happens with search (<ESC>/a for example):

---------------------------
katepart: Register  '-'  set to  "=10"
katepart: Register  "  set to point to " '-'
katepart: Register  '^'  set to  ""
katepart: Command already registered:  "s" . Aborting.
katepart:        "/"
katepart:        "a"
katepart: New text:  "a"
katepart: Final regex:  "a"
Segmentation fault (core dumped)
---------------------------
Comment 2 Boris Egorov 2015-03-10 09:20:43 UTC
Created attachment 91518 [details]
gdb stacktrace
Comment 3 Boris Egorov 2015-03-10 09:22:13 UTC
I've built ktexteditor with debug symbols and launch kate under gdb. Looks like a bug in regex which parses range or in the code calling this regex. Stacktrace attached.

Ubuntu 15.04
kate 5.0.0
Comment 4 Radics Péter 2015-03-16 15:54:06 UTC
apparently typing anything after ':', '/' or '?' crashes kate in vi-mode.
Comment 5 Christoph Cullmann 2017-07-24 21:33:50 UTC
Git commit 900337e6864beb09e0eaed935de5ed89398363b8 by Christoph Cullmann.
Committed on 24/07/2017 at 21:32.
Pushed by cullmann into branch 'master'.

perhaps avoid stringbuild crash

M  +1    -1    src/vimode/commandrangeexpressionparser.cpp

https://commits.kde.org/ktexteditor/900337e6864beb09e0eaed935de5ed89398363b8