Bug 364616

Summary: konsole crashes while typing inside nano editor
Product: [Applications] konsole Reporter: orionbelt2
Component: generalAssignee: Konsole Developer <konsole-devel>
Status: RESOLVED UPSTREAM    
Severity: crash CC: cfeck, orionbelt2
Priority: NOR Keywords: drkonqi
Version: 16.04.1   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Backtrace of konsole segmentation fault

Description orionbelt2 2016-06-21 22:28:15 UTC
Application: konsole (15.12.3)
 (Compiled from sources)
Qt Version: 5.5.1
Operating System: Linux 4.4.6-gentoo x86_64
Distribution (Platform): Gentoo Packages

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

I was typing a message in the nano editor, called by a mutt session. This has been happening since i was forced to switch to Plasma 5 a couple of weeks ago: My konsole sessions die sooner or later while i type inside nano. I have not been able to identify a specific sequence of characters before the crash. I often switch between several keyboard layouts while typing, in case that may be related.

Note that the crash always happens *while* i type something, never while i am off doing something else. This is a difference from all the reported possibly related bugs, and it is why i file it separately.

This is a show-stopper for me since konsole is my workhorse application, and this bug takes it down along with all its tabs!

The crash can be reproduced every time.

-- Backtrace:
Application: Konsole (konsole), signal: Segmentation fault
Using host libthread_db library "/lib64/libthread_db.so.1".
[Current thread is 1 (Thread 0x7fcfb3dc17c0 (LWP 32309))]

Thread 2 (Thread 0x7fcfab30b700 (LWP 32310)):
#0  0x00007fcfc61b71cd in poll () from /lib64/libc.so.6
#1  0x00007fcfbefcbac2 in ?? () from /usr/lib64/libxcb.so.1
#2  0x00007fcfbefcd72f in xcb_wait_for_event () from /usr/lib64/libxcb.so.1
#3  0x00007fcfad466cb9 in ?? () from /usr/lib64/libQt5XcbQpa.so.5
#4  0x00007fcfc2bf4ed2 in ?? () from /usr/lib64/libQt5Core.so.5
#5  0x00007fcfbeba9444 in start_thread () from /lib64/libpthread.so.0
#6  0x00007fcfc61c018d in clone () from /lib64/libc.so.6

Thread 1 (Thread 0x7fcfb3dc17c0 (LWP 32309)):
[KCrash Handler]
#6  0x00007fcfc2d9f860 in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib64/libQt5Core.so.5
#7  0x00007fcfad5408f5 in ?? () from /usr/lib64/qt5/plugins/platforminputcontexts/libcomposeplatforminputcontextplugin.so
#8  0x00007fcfad540dcb in ?? () from /usr/lib64/qt5/plugins/platforminputcontexts/libcomposeplatforminputcontextplugin.so
#9  0x00007fcfad46c0a6 in ?? () from /usr/lib64/libQt5XcbQpa.so.5
#10 0x00007fcfad464ade in QXcbConnection::handleXcbEvent(xcb_generic_event_t*) () from /usr/lib64/libQt5XcbQpa.so.5
#11 0x00007fcfad4668fb in QXcbConnection::processXcbEvents() () from /usr/lib64/libQt5XcbQpa.so.5
#12 0x00007fcfc2dc862a in QObject::event(QEvent*) () from /usr/lib64/libQt5Core.so.5
#13 0x00007fcfc35f66bc in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/libQt5Widgets.so.5
#14 0x00007fcfc35fbba8 in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/libQt5Widgets.so.5
#15 0x00007fcfc2d9f87d in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib64/libQt5Core.so.5
#16 0x00007fcfc2da2613 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib64/libQt5Core.so.5
#17 0x00007fcfc2dec8a3 in ?? () from /usr/lib64/libQt5Core.so.5
#18 0x00007fcfbcffbc6d in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#19 0x00007fcfbcffbf50 in ?? () from /usr/lib64/libglib-2.0.so.0
#20 0x00007fcfbcffbffc in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#21 0x00007fcfc2dec917 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQt5Core.so.5
#22 0x00007fcfc2d9e4da in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQt5Core.so.5
#23 0x00007fcfc2da57bc in QCoreApplication::exec() () from /usr/lib64/libQt5Core.so.5
#24 0x00007fcfc649ad92 in kdemain () from /usr/lib64/libkdeinit5_konsole.so
#25 0x00007fcfc60f7620 in __libc_start_main () from /lib64/libc.so.6
#26 0x00000000004007c9 in _start ()

Possible duplicates by query: bug 364135, bug 362919, bug 362415, bug 362408, bug 361934.

Reported using DrKonqi
Comment 1 orionbelt2 2016-06-22 02:00:11 UTC
I am adding that i updated konsole to version 16.04.1 and the bug is still there.
Comment 2 Christoph Feck 2016-06-28 19:00:29 UTC
Please try Qt 5.6.1. According to the backtrace, the bug is in Qt's xcb platform plugin.

If this is still reproducible with newer Qt version, please report this error to https://bugreports.qt.io/
Comment 3 orionbelt2 2016-06-30 20:17:12 UTC
Thanks for the feedback, Christoph.

I attempted to update to dev-qt/qtcore-5.6.1 on Gentoo, but the system wants me to basically upgrade many/all of my Qt packages... Unfortunately i cannot do this right now, it is a major upgrade to potentially unstable packages, and this is my work machine... I'll have to wait until Gentoo makes this (or higher) the stable version...

What i did instead: I upgraded x11-libs/libxcb and x11-proto/xcb-proto to 1.12 so that if, by any chance, it is actually an issue with XCB itself, it may be fixed. Konsole hasn't crashed so far, but i haven't been using it for too long since restarting KDE.

I'll put up another report here either way, whether it crashes or it keeps working for some time.
Comment 4 orionbelt2 2016-07-02 00:11:38 UTC
Unfortunately, upgrading x11-libs/libxcb and x11-proto/xcb-proto to 1.12 did not help...
Comment 5 orionbelt2 2016-07-04 12:07:25 UTC
OK, so i was able to come up with an easy way to upgrade all my Qt packages, including dev-qt/qtcore which is now at version 5.6.1.

Unfortunately, the bug is still there: After some time of intensive typing and keyboard layout switching in nano, called by mutt, the entire konsole crashes.

Please let me know if there something else that i could do to help with the debugging. This is a very serious problem.
Comment 6 Christoph Feck 2016-07-04 12:32:48 UTC
Does your distribution also offer debug symbol packages for Qt? Before it makes sense to report it to Qt developers, I would like to see an updated backtrace with debug symbol information.
Comment 7 orionbelt2 2016-07-05 00:35:47 UTC
Gentoo Linux builds from source, so it does not provide debug symbol packages but allows people to build packages that provide debug symbols:

https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces

I skimmed through the text, and although it does not sound complicated, there are still a few things i have to figure out since i have not done it before... Unfortunately, i do not have the time to do this right now, it will have to wait for a week or more...
Comment 8 orionbelt2 2017-03-29 14:12:22 UTC
In the weeks after i filed this bug, its frequency got reduced from a few times per day to a few times per week, and i found a way to preserve my work in between crashes, so the bug became less debilitating. However, after many months of no further improvement, the bug became again sufficiently annoying that i set up backtraces on all my dev-qt/* packages. The konsole crashed again, and here i am submitting a backtrace (see attachment). I hope this backtrace is more useful than my previous one. Thanks!
Comment 9 orionbelt2 2017-03-29 14:13:44 UTC
Created attachment 104797 [details]
Backtrace of konsole segmentation fault
Comment 10 Christoph Feck 2017-03-29 14:37:38 UTC
The backtrace is much better, and reveals the cause of the crash:

QComposeInputContext::commitText() tries to send an event to a NULL object. Please report this issue to Qt developers.
Comment 11 orionbelt2 2017-03-29 14:52:53 UTC
Thanks for the prompt feedback.

Well, i do not have an account on Qt's bug report system, and i think KDE devs often contribute bug reports there, so is there a way that you or someone else might want to do it? If not, i guess i'll have to bite the bullet...
Comment 12 Christoph Feck 2017-03-31 18:59:06 UTC
I cannot reproduce the bug, so I will not report it. If Qt developers need more information, only someone who can reproduce the bug will be able to provide it.

Checking available input method plugins in Qt, there is also "ibus" besides "compose", so you might check if switching to IBus helps to resolve the issue. On the other hand, we always had many crashes with input method helpers; it seems they are not used by many people.