Summary: | konsole crash in Konsole::PlainTextDecoder::decodeLine() on exit | ||
---|---|---|---|
Product: | [Applications] konsole | Reporter: | albrubesc |
Component: | general | Assignee: | Konsole Developer <konsole-devel> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | adam, albrubesc, aleixpol, antoine.gatineau, bughunt, casm, cbc.alves, christian, frealgagu, grosales, jani, jiri.rohlicek, junkblocker, martin.sandsmark, mgulick, mtilsted, nate, ninjalj, rdieter, robert, thanosk |
Priority: | VHI | Keywords: | drkonqi, wayland |
Version: | 21.04.0 | ||
Target Milestone: | --- | ||
Platform: | Fedora RPMs | ||
OS: | Linux | ||
See Also: | https://bugs.kde.org/show_bug.cgi?id=437689 | ||
Latest Commit: | 66e19aaf4110ced12c2607d85f3dfcf49f268b8f | Version Fixed In: | v21.08.0 |
Sentry Crash Report: | |||
Attachments: |
New crash information added by DrKonqi
Valgrind output New crash information added by DrKonqi New crash information added by DrKonqi |
Description
albrubesc
2021-05-05 13:25:34 UTC
Crash solved upgrading to Fedora 34. The bug returned, updated info and backtrace below: Application: konsole (21.04.0) Qt Version: 5.15.2 Frameworks Version: 5.82.0 Operating System: Linux 5.11.18-300.fc34.x86_64 Windowing System: Wayland Distribution: Fedora 34 (Thirty Four) --Backtrace: Application: Konsole (konsole), signal: Segmentation fault [KCrash Handler] #4 Konsole::PlainTextDecoder::decodeLine (this=<optimized out>, characters=<optimized out>, count=<optimized out>) at /usr/src/debug/konsole5-21.04.0-1.fc34.x86_64/src/decoders/PlainTextDecoder.cpp:106 #5 0x00007ff3f450f0cd in Konsole::TerminalDisplay::inputMethodQuery (this=0x55ccebc867c0, query=<optimized out>) at /usr/src/debug/konsole5-21.04.0-1.fc34.x86_64/src/terminalDisplay/TerminalDisplay.cpp:2375 #6 0x00007ff3f39c7d3c in QWidget::event(QEvent*) () from /lib64/libQt5Widgets.so.5 #7 0x00007ff3f3986e73 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib64/libQt5Widgets.so.5 #8 0x00007ff3f4a0ef48 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib64/libQt5Core.so.5 #9 0x00007ff3ef5b758a in QtWaylandClient::QWaylandTextInput::updateState(QFlags<Qt::InputMethodQuery>, unsigned int) () from /lib64/libQt5WaylandClient.so.5 #10 0x00007ff3f332758d in QGuiApplicationPrivate::_q_updateFocusObject(QObject*) () from /lib64/libQt5Gui.so.5 #11 0x00007ff3f4a3f4fd in void doActivate<false>(QObject*, int, void**) () from /lib64/libQt5Core.so.5 #12 0x00007ff3f3335e66 in QWindow::focusObjectChanged(QObject*) () from /lib64/libQt5Gui.so.5 #13 0x00007ff3f39c1d7b in QWidget::clearFocus() () from /lib64/libQt5Widgets.so.5 #14 0x00007ff3f39c2e48 in QWidget::~QWidget() () from /lib64/libQt5Widgets.so.5 #15 0x00007ff3f44a65a5 in Konsole::TerminalColor::~TerminalColor (this=<optimized out>, this=<optimized out>) at /usr/src/debug/konsole5-21.04.0-1.fc34.x86_64/x86_64-redhat-linux-gnu/src/konsoleprivate_autogen/DRAQINE3W2/../../../../src/terminalDisplay/TerminalColor.h:27 #16 Konsole::TerminalColor::~TerminalColor (this=<optimized out>, this=<optimized out>) at /usr/src/debug/konsole5-21.04.0-1.fc34.x86_64/x86_64-redhat-linux-gnu/src/konsoleprivate_autogen/DRAQINE3W2/../../../../src/terminalDisplay/TerminalColor.h:27 #17 0x00007ff3f4501373 in Konsole::TerminalDisplay::~TerminalDisplay (this=<optimized out>, this=<optimized out>) at /usr/src/debug/konsole5-21.04.0-1.fc34.x86_64/src/terminalDisplay/TerminalDisplay.cpp:360 #18 0x00007ff3f450156d in Konsole::TerminalDisplay::~TerminalDisplay (this=<optimized out>, this=<optimized out>) at /usr/src/debug/konsole5-21.04.0-1.fc34.x86_64/src/terminalDisplay/TerminalDisplay.cpp:362 #19 0x00007ff3f4a360c1 in QObject::event(QEvent*) () from /lib64/libQt5Core.so.5 #20 0x00007ff3f3986e73 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib64/libQt5Widgets.so.5 #21 0x00007ff3f4a0ef48 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib64/libQt5Core.so.5 #22 0x00007ff3f4a11c76 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /lib64/libQt5Core.so.5 #23 0x00007ff3f4a5bc57 in postEventSourceDispatch(_GSource*, int (*)(void*), void*) () from /lib64/libQt5Core.so.5 #24 0x00007ff3f26e44cf in g_main_context_dispatch () from /lib64/libglib-2.0.so.0 #25 0x00007ff3f27384e8 in g_main_context_iterate.constprop () from /lib64/libglib-2.0.so.0 #26 0x00007ff3f26e1c03 in g_main_context_iteration () from /lib64/libglib-2.0.so.0 #27 0x00007ff3f4a5b6f8 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5 #28 0x00007ff3f4a0d9b2 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5 #29 0x00007ff3f4a15544 in QCoreApplication::exec() () from /lib64/libQt5Core.so.5 #30 0x00007ff3f4dab88d in kdemain (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/konsole5-21.04.0-1.fc34.x86_64/src/main.cpp:220 #31 0x00007ff3f45e8b75 in __libc_start_main () from /lib64/libc.so.6 #32 0x000055cceaf3814e in _start () [Inferior 1 (process 18070) detached] Crash solved in konsole version 21.04.1 *** Bug 437689 has been marked as a duplicate of this bug. *** *** Bug 438239 has been marked as a duplicate of this bug. *** *** Bug 438282 has been marked as a duplicate of this bug. *** *** Bug 438593 has been marked as a duplicate of this bug. *** *** Bug 438616 has been marked as a duplicate of this bug. *** I can also reproduce with Ctrl+D and exiting using the application menu From the backtraces: During TerminalDisplay() destructor, _image is deleted and then TerminalColor() destructor is called, which being a QWidget calls QWidget::clearFocus(), which ends up transfering focus to TerminalDisplay. Under some circumstances (apparently something having to do with some Wayland compositor) this causes a call to TerminalDisplay::inputMethodQuery(..., Qt::ImSurroundingText), which then tries to access the already deleted _image. This should be fixed by https://invent.kde.org/utilities/konsole/-/commit/66e19aaf4110ced12c2607d85f3dfcf49f268b8f Can any of you guys test with the above commit? *** Bug 434600 has been marked as a duplicate of this bug. *** *** Bug 438717 has been marked as a duplicate of this bug. *** *** Bug 438885 has been marked as a duplicate of this bug. *** Even after installing a Fedora VM, I've been unable to reproduce this crash. Which Compositor and Input Method are you using? Can anyone confirm whether https://invent.kde.org/utilities/konsole/-/commit/66e19aaf4110ced12c2607d85f3dfcf49f268b8f fixes this crash? The following consistently crashes for me: 1. Open konsole from konsole with something like konsole -e bash & 2. Exit out of the new konsole using whatever means. (In reply to ninjalj from comment #14) > Even after installing a Fedora VM, I've been unable to reproduce this crash. > > Which Compositor and Input Method are you using? > > Can anyone confirm whether > https://invent.kde.org/utilities/konsole/-/commit/ > 66e19aaf4110ced12c2607d85f3dfcf49f268b8f fixes this crash? I rebuilt the konsole5 package in Fedora 34 with this patch applied, and it did fix the crash for me! The crash comes and goes with system updates. It actually occurs for me again. Application: konsole (21.04.2) Qt Version: 5.15.2 Frameworks Version: 5.83.0 Operating System: Linux 5.12.11-300.fc34.x86_64 x86_64 Windowing System: Wayland Distribution: Fedora 34 (Thirty Four) Compositor: kwin_wayland Input method: i don't know how to determine wich is in use, sorry. Ibus is installed so my guess is ibus, but i'm not sure. CC'ing Rex Dieter, as he may want to include https://invent.kde.org/utilities/konsole/-/commit/66e19aaf4110ced12c2607d85f3dfcf49f268b8f in the Fedora package. *** Bug 439479 has been marked as a duplicate of this bug. *** Created attachment 140205 [details]
New crash information added by DrKonqi
konsole (21.04.2) using Qt 5.15.2
Fedora 34, latest updates applied, on Thinkpad T450
KDE Plasma spin (Wayland session)
Konsole shows an chrash message everytime it is closed (either by command or using the window controls)
-- Backtrace (Reduced):
#4 0x00007f3846c449d8 in Konsole::PlainTextDecoder::decodeLine(Konsole::Character const*, int, unsigned char) () from /lib64/libkonsoleprivate.so.21
#5 0x00007f3846bffffd in Konsole::TerminalDisplay::inputMethodQuery(Qt::InputMethodQuery) const () from /lib64/libkonsoleprivate.so.21
#6 0x00007f384608c2bb in QWidget::event(QEvent*) () from /lib64/libQt5Widgets.so.5
#7 0x00007f3846049423 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib64/libQt5Widgets.so.5
#8 0x00007f3847127098 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib64/libQt5Core.so.5
I don't think that commit is related. What seems to happen is that the crash happens when PlainTextDecoder tries to read the last of the characters passed into it. And it is told that there is _usedColumns number of characters, and the characters are passed from `&_image[loc(0, cursorPos.y())]`. So I suspect what is happening is that after the reflow code changed there probably isn't necessarily _usedColumns number of characters per line anymore, maybe? I'm CCing in Carlos Alves, since he knows this code the best so maybe he spots something obvious here. And I can't reproduce it here (probably because I don't have some input method thing running), but if you can reproduce it could you run it under valgrind? I. e. just launch `valgrind konsole`, and exit to trigger the crash. After reading everything here, if it is reproduced just after konsole opens, it is probably not related to reflow. But I can't test it here, wayland doesn't run here, and it is a bug related to some wayland bahavior with the input. Luis Javier Merino seems to have tested it and solved. (In reply to Martin Sandsmark from comment #21) > I don't think that commit is related. > > What seems to happen is that the crash happens when PlainTextDecoder tries > to read the last of the characters passed into it. > > And it is told that there is _usedColumns number of characters, and the > characters are passed from `&_image[loc(0, cursorPos.y())]`. > > So I suspect what is happening is that after the reflow code changed there > probably isn't necessarily _usedColumns number of characters per line > anymore, maybe? > > I'm CCing in Carlos Alves, since he knows this code the best so maybe he > spots something obvious here. Created attachment 140243 [details]
Valgrind output
Created attachment 140583 [details]
New crash information added by DrKonqi
konsole (21.04.2) using Qt 5.15.2
- What I was doing when the application crashed:
When I log out from the last session in konsole (ctrl+d or exit).
Note: it happens only with wayland, not with X11
-- Backtrace (Reduced):
#4 0x00007f491420b9d8 in Konsole::PlainTextDecoder::decodeLine(Konsole::Character const*, int, unsigned char) () from /lib64/libkonsoleprivate.so.21
#5 0x00007f49141c6ffd in Konsole::TerminalDisplay::inputMethodQuery(Qt::InputMethodQuery) const () from /lib64/libkonsoleprivate.so.21
#6 0x00007f49136532bb in QWidget::event(QEvent*) () from /lib64/libQt5Widgets.so.5
#7 0x00007f4913610423 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib64/libQt5Widgets.so.5
#8 0x00007f49146ee098 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib64/libQt5Core.so.5
Since various versions ago, i'm not experiencing this 'crash' anymore. Konsole: 21.08.2 Frameworks: 5.86.0 Qt: 5.15.2 Kernel: 5.14.9-200.fc34.x86_64 Should be fixed by https://invent.kde.org/utilities/konsole/-/commit/66e19aaf4110ced12c2607d85f3dfcf49f268b8f Closing. Feel free to reopen if it happens again. *** Bug 440920 has been marked as a duplicate of this bug. *** Created attachment 149487 [details]
New crash information added by DrKonqi
konsole (21.12.2) using Qt 5.15.3
- What I was doing when the application crashed:
I closed nvim and couple of tabs. Then closed the last tab and then Konsole crashed.
-- Backtrace (Reduced):
#4 0x00007f1215710dee in KNS3::QtQuickDialogWrapper::exec() () from /lib64/libKF5NewStuff.so.5
#5 0x00007f1215700d84 in KNS3::Button::showDialog() () from /lib64/libKF5NewStuff.so.5
#6 0x00007f12162c0c36 in void doActivate<false>(QObject*, int, void**) () from /lib64/libQt5Core.so.5
#7 0x00007f1216ef5ae6 in QAbstractButton::clicked(bool) () from /lib64/libQt5Widgets.so.5
#8 0x00007f1216ef5d5e in QAbstractButtonPrivate::emitClicked() () from /lib64/libQt5Widgets.so.5
Comment 29: That looks like bug 452593. Had you tried to install a new colorscheme? It's happening to me with the latest version of konsole 22.08.1 |