Bug 393414

Summary: Konsole crashed after detaching a tab from a window while current tab is running something
Product: [Applications] konsole Reporter: 林博仁(Buo-ren, Lin) <Buo.Ren.Lin>
Component: generalAssignee: Konsole Developer <konsole-devel>
Status: RESOLVED FIXED    
Severity: crash CC: Buo.Ren.Lin, nate
Priority: NOR Keywords: drkonqi
Version: 18.04.0   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: New crash information added by DrKonqi
New crash information added by DrKonqi
New crash information added by DrKonqi

Description 林博仁(Buo-ren, Lin) 2018-04-23 05:35:56 UTC
Application: konsole (18.04.0)

Qt Version: 5.10.0
Frameworks Version: 5.45.0
Operating System: Linux 4.13.0-38-generic x86_64
Distribution: KDE neon User Edition 5.12

-- Information about the crash:
- What I was doing when the application crashed:
* I am building a project in a tab while browsing htop in another, I (accidentally) detached the htop tab and attempt to reattach it back to the window

-- Backtrace:
Application: Konsole (konsole), signal: Segmentation fault
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Current thread is 1 (Thread 0x7fd2369a28c0 (LWP 4686))]

Thread 2 (Thread 0x7fd21a185700 (LWP 4688)):
#0  0x00007fd23635374d in poll () at ../sysdeps/unix/syscall-template.S:84
#1  0x00007fd22c07d38c in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007fd22c07d49c in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007fd2326cd5cb in QEventDispatcherGlib::processEvents (this=0x7fd2140008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:425
#4  0x00007fd23267464a in QEventLoop::exec (this=this@entry=0x7fd21a184cd0, flags=..., flags@entry=...) at kernel/qeventloop.cpp:212
#5  0x00007fd232494554 in QThread::exec (this=this@entry=0x7fd230824d60 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>) at thread/qthread.cpp:522
#6  0x00007fd2305b02c5 in QDBusConnectionManager::run (this=0x7fd230824d60 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>) at qdbusconnection.cpp:178
#7  0x00007fd2324996eb in QThreadPrivate::start (arg=0x7fd230824d60 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>) at thread/qthread_unix.cpp:376
#8  0x00007fd22df296ba in start_thread (arg=0x7fd21a185700) at pthread_create.c:333
#9  0x00007fd23635f41d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 1 (Thread 0x7fd2369a28c0 (LWP 4686)):
[KCrash Handler]
#6  QWeakPointer<QObject>::data (this=0x200020250200a5) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qsharedpointer_impl.h:565
#7  QPointer<Konsole::Session>::data (this=0x200020250200a5) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qpointer.h:86
#8  QPointer<Konsole::Session>::operator Konsole::Session* (this=0x200020250200a5) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qpointer.h:92
#9  Konsole::SessionController::isReadOnly (this=0x2000202502006d) at /workspace/build/src/SessionController.cpp:1579
#10 0x00007fd235ff6c6f in Konsole::Vt102Emulation::sendKeyEvent (this=0x17b6000, event=0x7ffd643038f0) at /workspace/build/src/Vt102Emulation.cpp:1049
#11 0x00007fd2326a37b6 in QtPrivate::QSlotObjectBase::call (a=0x7ffd643038a0, r=0x17b6000, this=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:378
#12 QMetaObject::activate (sender=sender@entry=0x1c76b40, signalOffset=<optimized out>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7ffd643038a0) at kernel/qobject.cpp:3749
#13 0x00007fd2326a3d97 in QMetaObject::activate (sender=sender@entry=0x1c76b40, m=m@entry=0x7fd23624fea0 <Konsole::TerminalDisplay::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7ffd643038a0) at kernel/qobject.cpp:3628
#14 0x00007fd23600176f in Konsole::TerminalDisplay::keyPressedSignal (this=this@entry=0x1c76b40, _t1=_t1@entry=0x7ffd643038f0) at /workspace/build/obj-x86_64-linux-gnu/src/moc_TerminalDisplay.cpp:396
#15 0x00007fd235fe10ce in Konsole::TerminalDisplay::inputMethodEvent (this=0x1c76b40, event=0x7ffd64303c80) at /workspace/build/src/TerminalDisplay.cpp:3277
#16 0x00007fd233688f88 in QWidget::event (this=this@entry=0x1c76b40, event=event@entry=0x7ffd64303c80) at kernel/qwidget.cpp:9197
#17 0x00007fd235fe2aca in Konsole::TerminalDisplay::event (this=0x1c76b40, event=0x7ffd64303c80) at /workspace/build/src/TerminalDisplay.cpp:3559
#18 0x00007fd233649acc in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x1c76b40, e=0x7ffd64303c80) at kernel/qapplication.cpp:3732
#19 0x00007fd233651417 in QApplication::notify (this=0x1371cb0, receiver=0x1c76b40, e=0x7ffd64303c80) at kernel/qapplication.cpp:3491
#20 0x00007fd2326763c8 in QCoreApplication::notifyInternal2 (receiver=receiver@entry=0x1c76b40, event=event@entry=0x7ffd64303c80) at kernel/qcoreapplication.cpp:1044
#21 0x00007fd21a1909d7 in QCoreApplication::sendEvent (event=0x7ffd64303c80, receiver=0x1c76b40) at ../../../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:234
#22 QIBusPlatformInputContext::commitText (this=0x1407b70, text=...) at qibusplatforminputcontext.cpp:274
#23 0x00007fd21a198c59 in QIBusPlatformInputContext::qt_static_metacall (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>) at .moc/moc_qibusplatforminputcontext.cpp:112
#24 0x00007fd2326a3489 in QMetaObject::activate (sender=sender@entry=0x13f6d50, signalOffset=<optimized out>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7ffd64303ef0) at kernel/qobject.cpp:3766
#25 0x00007fd2326a3d97 in QMetaObject::activate (sender=sender@entry=0x13f6d50, m=m@entry=0x7fd21a3a0d60 <QIBusInputContextProxy::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7ffd64303ef0) at kernel/qobject.cpp:3628
#26 0x00007fd21a19b2ee in QIBusInputContextProxy::CommitText (_t1=..., this=0x13f6d50) at .moc/moc_qibusinputcontextproxy.cpp:516
#27 QIBusInputContextProxy::qt_static_metacall (_o=_o@entry=0x13f6d50, _c=_c@entry=QMetaObject::InvokeMetaMethod, _id=_id@entry=0, _a=_a@entry=0x7ffd64304080) at .moc/moc_qibusinputcontextproxy.cpp:220
#28 0x00007fd21a19c4d5 in QIBusInputContextProxy::qt_metacall (this=0x13f6d50, _c=QMetaObject::InvokeMetaMethod, _id=0, _a=0x7ffd64304080) at .moc/moc_qibusinputcontextproxy.cpp:502
#29 0x00007fd2305bc633 in QDBusConnectionPrivate::deliverCall (this=<optimized out>, object=<optimized out>, msg=..., metaTypes=..., slotIdx=<optimized out>) at qdbusintegrator.cpp:998
#30 0x00007fd2326a44c9 in QObject::event (this=0x13f6d50, e=<optimized out>) at kernel/qobject.cpp:1246
#31 0x00007fd233649acc in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x13f6d50, e=0x7fd214011080) at kernel/qapplication.cpp:3732
#32 0x00007fd233651417 in QApplication::notify (this=0x1371cb0, receiver=0x13f6d50, e=0x7fd214011080) at kernel/qapplication.cpp:3491
#33 0x00007fd2326763c8 in QCoreApplication::notifyInternal2 (receiver=0x13f6d50, event=event@entry=0x7fd214011080) at kernel/qcoreapplication.cpp:1044
#34 0x00007fd232678fcb in QCoreApplication::sendEvent (event=0x7fd214011080, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:234
#35 QCoreApplicationPrivate::sendPostedEvents (receiver=receiver@entry=0x0, event_type=event_type@entry=0, data=0x1372ce0) at kernel/qcoreapplication.cpp:1719
#36 0x00007fd232679438 in QCoreApplication::sendPostedEvents (receiver=receiver@entry=0x0, event_type=event_type@entry=0) at kernel/qcoreapplication.cpp:1573
#37 0x00007fd2326cdfa3 in postEventSourceDispatch (s=0x1414950) at kernel/qeventdispatcher_glib.cpp:276
#38 0x00007fd22c07d197 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#39 0x00007fd22c07d3f0 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#40 0x00007fd22c07d49c in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#41 0x00007fd2326cd5af in QEventDispatcherGlib::processEvents (this=this@entry=0x13f4a30, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#42 0x00007fd2239e81a1 in QPAEventDispatcherGlib::processEvents (this=0x13f4a30, flags=...) at qeventdispatcher_glib.cpp:69
#43 0x00007fd23267464a in QEventLoop::exec (this=this@entry=0x7ffd64304660, flags=..., flags@entry=...) at kernel/qeventloop.cpp:212
#44 0x00007fd23267d854 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1332
#45 0x00007fd232e9983c in QGuiApplication::exec () at kernel/qguiapplication.cpp:1687
#46 0x00007fd233649a25 in QApplication::exec () at kernel/qapplication.cpp:2917
#47 0x00007fd23664abd7 in kdemain (argc=1, argv=<optimized out>) at /workspace/build/src/main.cpp:190
#48 0x00007fd236278830 in __libc_start_main (main=0x4006b0 <main(int, char**)>, argc=1, argv=0x7ffd64304968, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffd64304958) at ../csu/libc-start.c:291
#49 0x00000000004006e9 in _start ()

Reported using DrKonqi
Comment 1 Kurt Hindenburg 2018-05-17 14:47:46 UTC
Is this something you can reproduce or just a one time crash?
Comment 2 林博仁(Buo-ren, Lin) 2018-05-17 16:01:04 UTC
(In reply to Kurt Hindenburg from comment #1)
> Is this something you can reproduce or just a one time crash?

It is a one time crash, I have no idea how to reproduce it.
Comment 3 林博仁(Buo-ren, Lin) 2018-05-26 13:14:45 UTC
Created attachment 112884 [details]
New crash information added by DrKonqi

konsole (18.04.1) using Qt 5.10.0

I have again accidentally reproduced the seemingly same crash, here's the details:

- What I was doing when the application crashed:
1. Open two tabs
2. On Tab 1, run a software's configure script (FFmpeg to be particular)  (also it is ran in a LXD container, so the working directory doesn't really change at the time)
3. When the configure script is flushing the terminal in Tab 1, detach Tab 2.

In some circumstances Konsole will crash shortly after step 3, not sure the probability though...

-- Backtrace (Reduced):
#6  QWeakPointer<QObject>::data (this=0x20000000000139) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qsharedpointer_impl.h:565
#7  QPointer<Konsole::Session>::data (this=0x20000000000139) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qpointer.h:86
#8  QPointer<Konsole::Session>::operator Konsole::Session* (this=0x20000000000139) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qpointer.h:92
#9  Konsole::SessionController::isReadOnly (this=0x20000000000101) at /workspace/build/src/SessionController.cpp:1579
#10 0x00007fdd2f5c7c6f in Konsole::Vt102Emulation::sendKeyEvent (this=0x24352e0, event=0x7ffdc86da1d0) at /workspace/build/src/Vt102Emulation.cpp:1049
Comment 4 林博仁(Buo-ren, Lin) 2018-05-26 13:19:40 UTC
UPDATE: I'm wrong about the step 2, if I remember correctly I'm actually running `make --jobs=4` instead of the configure script of FFmpeg.
Comment 5 林博仁(Buo-ren, Lin) 2018-06-03 20:56:13 UTC
Created attachment 113053 [details]
New crash information added by DrKonqi

kdeinit5 (18.04.1) using Qt 5.10.0

I've reproduced this crashed again, but with a slightly different crash signature and reproduce details

- What I was doing when the application crashed:

- Detach a tab and re-attach it in a few seconds
- What different with the previous bug repruduction is that at the moment I don't really doing somethin in the other tabs(not printing anything)

-- Backtrace (Reduced):
#6  std::__atomic_base<int>::load (__m=std::memory_order_relaxed, this=0x7fce00000018) at /usr/include/c++/5/bits/atomic_base.h:396
#7  QAtomicOps<int>::load<int> (_q_value=...) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qatomic_cxx11.h:227
#8  QBasicAtomicInteger<int>::load (this=0x7fce00000018) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qbasicatomic.h:102
#9  QWeakPointer<QObject>::data (this=0x277ac48) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qsharedpointer_impl.h:565
#10 QPointer<Konsole::Session>::data (this=0x277ac48) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qpointer.h:86
Comment 6 林博仁(Buo-ren, Lin) 2018-06-22 09:23:33 UTC
Created attachment 113505 [details]
New crash information added by DrKonqi

konsole (18.04.2) using Qt 5.11.0

- What I was doing when the application crashed:

Crashed again, this time I simply just return the focus to Konsole and try to type some command, no tab detach/attaching.

-- Backtrace (Reduced):
#6  QWeakPointer<QObject>::data (this=0xff3d4446ff3e457f) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qsharedpointer_impl.h:565
#7  QPointer<Konsole::Session>::data (this=0xff3d4446ff3e457f) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qpointer.h:86
#8  QPointer<Konsole::Session>::operator Konsole::Session* (this=0xff3d4446ff3e457f) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qpointer.h:92
#9  Konsole::SessionController::isReadOnly (this=0xff3d4446ff3e4547) at /workspace/build/src/SessionController.cpp:1579
#10 0x00007fc50f51ec6f in Konsole::Vt102Emulation::sendKeyEvent (this=0x1cbdc20, event=0x7ffff39b7ed0) at /workspace/build/src/Vt102Emulation.cpp:1049
Comment 7 Kurt Hindenburg 2018-10-11 14:48:20 UTC
*** Bug 398157 has been marked as a duplicate of this bug. ***
Comment 8 Kurt Hindenburg 2018-10-12 14:10:22 UTC
Can you test 18.08 or even master?  Master and the next release 18.12 has all new tab window code.
Comment 9 Nate Graham 2018-10-20 21:54:51 UTC
As Kurt said, it's likely that this has already been fixed due to the rewrite of the code pertaining to this part of Konsole. Please re-open the bug if you still experience the bug using Konsole 18.12 once it is released (or git master right now, if you can compile software from source). Thanks!