[Konsole-devel] [konsole] [Bug 252602] Konsole (sometimes) crashes when trying to exit from shell with Ctrl+D, especially when ibus is running
Matt Mullins
mmullins at mmlx.us
Thu May 8 05:18:33 UTC 2014
https://bugs.kde.org/show_bug.cgi?id=252602
Matt Mullins <mmullins at mmlx.us> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mmullins at mmlx.us
--- Comment #22 from Matt Mullins <mmullins at mmlx.us> ---
It looks like the TerminalDisplay is deallocated by QObject::deleteLater(),
which is sometimes delivered part-way through processing an X11 event — the
IBus input module's processKeyEvent() creates a QEventLoop to speak to DBus,
and exec() on that may deliver the deletion event and call ~TerminalDisplay
while there's still a reference to the TerminalDisplay on the stack.
Here's the stack trace of the errant destruction:
#0 Konsole::TerminalDisplay::~TerminalDisplay (this=0x5358120,
__in_chrg=<optimized out>) at
/home/mmullins/debug_konsole/BUILD/konsole-4.12.4/src/TerminalDisplay.cpp:408
#1 0x00007ffff5b65ee8 in QObject::event (this=this at entry=0x5358120,
e=e at entry=0x56d7050) at kernel/qobject.cpp:1203
#2 0x00007ffff4a65e33 in QWidget::event (this=this at entry=0x5358120,
event=event at entry=0x56d7050) at kernel/qwidget.cpp:8859
#3 0x00007ffff796823a in Konsole::TerminalDisplay::event (this=0x5358120,
event=0x56d7050) at
/home/mmullins/debug_konsole/BUILD/konsole-4.12.4/src/TerminalDisplay.cpp:2997
#4 0x00007ffff4a12ebc in QApplicationPrivate::notify_helper
(this=this at entry=0x6bb550, receiver=receiver at entry=0x5358120,
e=e at entry=0x56d7050) at kernel/qapplication.cpp:4565
#5 0x00007ffff4a19825 in QApplication::notify (this=this at entry=0x7fffffffd970,
receiver=receiver at entry=0x5358120, e=e at entry=0x56d7050) at
kernel/qapplication.cpp:4351
#6 0x00007ffff683cb0a in KApplication::notify (this=0x7fffffffd970,
receiver=0x5358120, event=0x56d7050) at
/usr/src/debug/kdelibs-4.12.4/kdeui/kernel/kapplication.cpp:311
#7 0x00007ffff5b4cebd in QCoreApplication::notifyInternal
(this=0x7fffffffd970, receiver=receiver at entry=0x5358120,
event=event at entry=0x56d7050) at kernel/qcoreapplication.cpp:953
#8 0x00007ffff5b500d5 in sendEvent (event=0x56d7050, receiver=0x5358120) at
kernel/qcoreapplication.h:231
#9 QCoreApplicationPrivate::sendPostedEvents (receiver=receiver at entry=0x0,
event_type=event_type at entry=0, data=0x60e3e0) at
kernel/qcoreapplication.cpp:1577
#10 0x00007ffff5b50573 in QCoreApplication::sendPostedEvents
(receiver=receiver at entry=0x0, event_type=event_type at entry=0) at
kernel/qcoreapplication.cpp:1470
#11 0x00007ffff5b7c253 in sendPostedEvents () at kernel/qcoreapplication.h:236
#12 postEventSourceDispatch (s=s at entry=0x6bdb90) at
kernel/qeventdispatcher_glib.cpp:280
#13 0x00007fffee3a82a6 in g_main_dispatch (context=0x6be170) at gmain.c:3066
#14 g_main_context_dispatch (context=context at entry=0x6be170) at gmain.c:3642
#15 0x00007fffee3a8628 in g_main_context_iterate
(context=context at entry=0x6be170, block=block at entry=1,
dispatch=dispatch at entry=1, self=<optimized out>) at gmain.c:3713
#16 0x00007fffee3a86dc in g_main_context_iteration (context=0x6be170,
may_block=1) at gmain.c:3774
#17 0x00007ffff5b7bad5 in QEventDispatcherGlib::processEvents (this=0x60fc90,
flags=...) at kernel/qeventdispatcher_glib.cpp:425
#18 0x00007ffff4ab4db6 in QGuiEventDispatcherGlib::processEvents
(this=<optimized out>, flags=...) at kernel/qguieventdispatcher_glib.cpp:207
#19 0x00007ffff5b4b95f in QEventLoop::processEvents
(this=this at entry=0x7fffffffd100, flags=...) at kernel/qeventloop.cpp:149
#20 0x00007ffff5b4bcad in QEventLoop::exec (this=this at entry=0x7fffffffd100,
flags=...) at kernel/qeventloop.cpp:204
#21 0x00007fffd915c575 in IBus::InputContext::processKeyEvent (this=<optimized
out>, keyval=<optimized out>, keycode=<optimized out>,
state=state at entry=1073741844) at
/usr/src/debug/ibus-qt-1.3.3-Source/src/qibusinputcontext.cpp:160
#22 0x00007fffd938b377 in IBusInputContext::x11FilterEvent (this=0x9da500,
keywidget=<optimized out>, xevent=0x7fffffffd440) at
/usr/src/debug/ibus-qt-1.3.3-Source/qtim/ibus-input-context.cpp:311
#23 0x00007ffff4a8d2e2 in QApplication::x11ProcessEvent (this=0x7fffffffd970,
event=event at entry=0x7fffffffd440) at kernel/qapplication_x11.cpp:3345
#24 0x00007ffff4ab4c34 in x11EventSourceDispatch (s=s at entry=0x6be2d0,
callback=0x0, user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:148
#25 0x00007fffee3a82a6 in g_main_dispatch (context=0x6be170) at gmain.c:3066
#26 g_main_context_dispatch (context=context at entry=0x6be170) at gmain.c:3642
#27 0x00007fffee3a8628 in g_main_context_iterate
(context=context at entry=0x6be170, block=block at entry=1,
dispatch=dispatch at entry=1, self=<optimized out>) at gmain.c:3713
#28 0x00007fffee3a86dc in g_main_context_iteration (context=0x6be170,
may_block=1) at gmain.c:3774
#29 0x00007ffff5b7bad5 in QEventDispatcherGlib::processEvents (this=0x60fc90,
flags=...) at kernel/qeventdispatcher_glib.cpp:425
#30 0x00007ffff4ab4db6 in QGuiEventDispatcherGlib::processEvents
(this=<optimized out>, flags=...) at kernel/qguieventdispatcher_glib.cpp:207
#31 0x00007ffff5b4b95f in QEventLoop::processEvents
(this=this at entry=0x7fffffffd830, flags=...) at kernel/qeventloop.cpp:149
#32 0x00007ffff5b4bcad in QEventLoop::exec (this=this at entry=0x7fffffffd830,
flags=...) at kernel/qeventloop.cpp:204
#33 0x00007ffff5b51399 in QCoreApplication::exec () at
kernel/qcoreapplication.cpp:1225
#34 0x00007ffff4a1152c in QApplication::exec () at kernel/qapplication.cpp:3823
#35 0x00007ffff7bd2baa in kdemain (argc=4, argv=0x7fffffffdab8) at
/home/mmullins/debug_konsole/BUILD/konsole-4.12.4/src/main.cpp:86
#36 0x00007ffff2866d65 in __libc_start_main (main=0x400850 <main(int, char**)>,
argc=4, argv=0x7fffffffdab8, init=<optimized out>, fini=<optimized out>,
rtld_fini=<optimized out>, stack_end=0x7fffffffdaa8) at libc-start.c:285
#37 0x0000000000400881 in _start ()
The QEventLoop in frame #32 is not the same this pointer as in frame #20.
I suppose a workaround would be to setEnabled(false) at the time the
TerminalDisplay is queued for deletion, because after reading the Qt sources,
that should prevent the x11FilterEvent call in the first place. I'm still
conflicted whether that belongs in the application, Qt, or if the
IBusInputContext needs a rearchitecture.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the konsole-devel
mailing list