| Summary: | Crash using 'g' in Vi-input mode | ||
|---|---|---|---|
| Product: | [Frameworks and Libraries] frameworks-ktexteditor | Reporter: | Francis Herne <mail> |
| Component: | general | Assignee: | KWrite Developers <kwrite-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | crash | ||
| Priority: | NOR | ||
| Version First Reported In: | 5.22.0 | ||
| Target Milestone: | --- | ||
| Platform: | Arch Linux | ||
| OS: | Linux | ||
| URL: | https://phabricator.kde.org/D1684 | ||
| Latest Commit: | http://commits.kde.org/ktexteditor/6571af1abf9da2cce4bdc8b20fdd4436d840d107 | Version Fixed/Implemented In: | |
| Sentry Crash Report: | |||
|
Description
Francis Herne
2016-03-11 15:34:02 UTC
Kate is 15.12.2, KTextEditor is 5.19.0. Latest version in the bugs.kde.org dropdown is '5.0.0', some newer options would be nice. Moving, since this occurs with KWrite and KDevelop.
KTextEditor compiled with debug symbols:
[20:50][436][flh ~/]$ cat kate_out
Thread 1 "kate" received signal SIGSEGV, Segmentation fault.
0x00007ffff799ec7b in KateVi::EmulatedCommandBar::executeCommand (this=this@entry=0xbad790, commandToExecute=...) at /home/flh/ktexteditor/src/ktexteditor-5.19.0/src/vimode/emulatedcommandbar.cpp:1142
1142 if (range.isValid() && !p->supportsRange(cmd)) {
#0 0x00007ffff799ec7b in KateVi::EmulatedCommandBar::executeCommand (this=this@entry=0xbad790, commandToExecute=...) at /home/flh/ktexteditor/src/ktexteditor-5.19.0/src/vimode/emulatedcommandbar.cpp:1142
p = 0x0
ci = <optimized out>
n = <optimized out>
textlen = <optimized out>
commandResponseMessage = {static null = {<No data fields>}, d = 0x7ffff32eba20 <QArrayData::shared_null>}
cmd = {static null = {<No data fields>}, d = 0xe179e0}
range = {m_start = {m_line = 0, m_column = 0}, m_end = {m_line = 0, m_column = 0}}
#1 0x00007ffff79a1d98 in KateVi::EmulatedCommandBar::handleKeyPress (this=0xbad790, keyEvent=keyEvent@entry=0x7fffffffd100) at /home/flh/ktexteditor/src/ktexteditor-5.19.0/src/vimode/emulatedcommandbar.cpp:1036
commandToExecute = {static null = {<No data fields>}, d = 0xe2df90}
parsedSedExpression = {parsedSuccessfully = false, findBeginPos = 0, findEndPos = -225121536, replaceBeginPos = 32767, replaceEndPos = 64, delimiter = {ucs = 0}}
commandResponseMessage = {static null = {<No data fields>}, d = 0x6}
#2 0x00007ffff798d5fd in KateVi::InputModeManager::handleKeypress (this=0x14727d0, e=0x7fffffffd100) at /home/flh/ktexteditor/src/ktexteditor-5.19.0/src/vimode/inputmodemanager.cpp:147
res = false
keyIsPartOfMapping = false
isSyntheticSearchCompletedKeyPress = false
#3 0x00007ffff323ade4 in QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5
#4 0x00007ffff48b60fe in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#5 0x00007ffff48bb6d4 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#6 0x00007ffff323b03a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5
#7 0x00007ffff798da06 in QCoreApplication::sendEvent (event=0x7fffffffd100, receiver=<optimized out>) at /usr/include/qt/QtCore/qcoreapplication.h:227
No locals.
#8 KateVi::InputModeManager::feedKeyPresses (this=0x14727d0, keyPresses=...) at /home/flh/ktexteditor/src/ktexteditor-5.19.0/src/vimode/inputmodemanager.cpp:235
decoded = {static null = {<No data fields>}, d = 0x121e5a0}
k = <incomplete type>
destWidget = <optimized out>
_container_ = {c = {static null = {<No data fields>}, d = 0x121d700}, i = 0x121d718, e = 0x121d71a, control = 1}
key = <optimized out>
mods = {i = 0}
text = {static null = {<No data fields>}, d = 0x7ffff32eba20 <QArrayData::shared_null>}
#9 0x00007ffff79a4314 in KateVi::KeyMapper::playBackRejectedKeys (this=this@entry=0xe31e80) at /home/flh/ktexteditor/src/ktexteditor-5.19.0/src/vimode/keymapper.cpp:69
mappingKeys = {static null = {<No data fields>}, d = 0x121d700}
#10 0x00007ffff79a470e in KateVi::KeyMapper::handleKeypress (this=0xe31e80, key=..., key@entry=...) at /home/flh/ktexteditor/src/ktexteditor-5.19.0/src/vimode/keymapper.cpp:122
isPartialMapping = <optimized out>
isFullMapping = <optimized out>
#11 0x00007ffff798d590 in KateVi::InputModeManager::handleKeypress (this=0x14727d0, e=0x7fffffffda70) at /home/flh/ktexteditor/src/ktexteditor-5.19.0/src/vimode/inputmodemanager.cpp:133
key = {ucs = 57424}
res = false
keyIsPartOfMapping = false
isSyntheticSearchCompletedKeyPress = false
#12 0x00007ffff323ade4 in QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5
#13 0x00007ffff48b60fe in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#14 0x00007ffff48bb6d4 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#15 0x00007ffff323b03a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5
#16 0x00007ffff49202f3 in ?? () from /usr/lib/libQt5Widgets.so.5
#17 0x00007ffff48b6124 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#18 0x00007ffff48baf78 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#19 0x00007ffff323b03a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5
#20 0x00007ffff410d1b8 in QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyEvent*) () from /usr/lib/libQt5Gui.so.5
#21 0x00007ffff41124c5 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) () from /usr/lib/libQt5Gui.so.5
#22 0x00007ffff40f0a1b in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Gui.so.5
#23 0x00007fffe4e4c750 in ?? () from /usr/lib/libQt5XcbQpa.so.5
#24 0x00007fffee9c3d87 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#25 0x00007fffee9c3fe0 in ?? () from /usr/lib/libglib-2.0.so.0
#26 0x00007fffee9c408c in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#27 0x00007ffff329318f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#28 0x00007ffff323957a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#29 0x00007ffff32421fc in QCoreApplication::exec() () from /usr/lib/libQt5Core.so.5
#30 0x0000000000439fe0 in main ()
This is caused by the command 'g' not actually existing; KTE crashes when given a range for a nonexistent command. Git commit 691c0315868511edff8048081e6e8b85c6653816 by Christoph Cullmann. Committed on 26/05/2016 at 14:34. Pushed by cullmann into branch 'master'. vimode: Don't crash when given a range for a nonexistent command. Patch by Francis Herne. When entering a range for a nonexistent command ,p is dereferenced before the null check. Move that check to before p is used. Differential Revision: D1684 M +14 -14 src/vimode/emulatedcommandbar.cpp http://commits.kde.org/ktexteditor/691c0315868511edff8048081e6e8b85c6653816 Git commit 6571af1abf9da2cce4bdc8b20fdd4436d840d107 by Simon St James. Committed on 17/06/2016 at 08:14. Pushed by sstjames into branch 'master'. The original patch (691c0315868511edff8048081e6e8b85c6653816) from Francis Herne got lost in the merge of the emulated command bar refactoring: I'm re-instating it here, this time with a test. Original commit message: vimode: Don't crash when given a range for a nonexistent command. Patch by Francis Herne. When entering a range for a nonexistent command ,p is dereferenced before the null check. Move that check to before p is used. Differential Revision: D1684 M +3 -0 autotests/src/vimode/emulatedcommandbar.cpp M +14 -15 src/vimode/emulatedcommandbar/commandmode.cpp http://commits.kde.org/ktexteditor/6571af1abf9da2cce4bdc8b20fdd4436d840d107 |