Bug 296239

Summary: Konsole 4.8.1 (KDE 4.8.1, Kubuntu 11.10, 64 bit) has crashed when closing a tab
Product: [Applications] konsole Reporter: Thomas Dreibholz <dreibh>
Component: generalAssignee: Konsole Developer <konsole-devel>
Status: RESOLVED FIXED    
Severity: crash CC: adaptee
Priority: NOR    
Version: 2.8.1   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In: 4.8.2
Sentry Crash Report:

Description Thomas Dreibholz 2012-03-17 21:25:38 UTC
Application: konsole (2.8.1)
KDE Platform Version: 4.8.1 (4.8.1)
Qt Version: 4.8.0
Operating System: Linux 3.0.0-16-generic x86_64
Distribution: Ubuntu 11.10

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

Konsole 4.8.1 (KDE 4.8.1, Kubuntu 11.10, 64 bit) has crashed when closing a tab.

-- Backtrace:
Application: Konsole (konsole), signal: Segmentation fault
[Current thread is 1 (Thread 0x7fc4fb0167a0 (LWP 2178))]

Thread 2 (Thread 0x7fc4e4df9700 (LWP 2444)):
#0  0xffffffffff60017b in ?? ()
#1  0x00007fc4e4df8ad0 in ?? ()
#2  0x00007fffcf5ff7e7 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 1 (Thread 0x7fc4fb0167a0 (LWP 2178)):
[KCrash Handler]
#6  QMetaObject::activate (sender=0x11bf590, m=<optimized out>, local_signal_index=<optimized out>, argv=0x7fffcf571070) at kernel/qobject.cpp:3484
#7  0x00007fc4fa5f9a11 in Konsole::Emulation::stateSet (this=<optimized out>, _t1=2) at ./Emulation.moc:182
#8  0x00007fc4fa5f9bd0 in Konsole::Emulation::receiveData (this=0x11bf590, text=0x7fc4fa6678e9 "\033[1m\033[31m", length=9) at ../../src/Emulation.cpp:242
#9  0x00007fc4fa622d9b in Konsole::Session::terminalWarning (this=0x11bf070, message=...) at ../../src/Session.cpp:391
#10 0x00007fc4fa625669 in Konsole::Session::done (this=0x11bf070, exitCode=<optimized out>, exitStatus=QProcess::CrashExit) at ../../src/Session.cpp:875
#11 0x00007fc4fa6285ee in Konsole::Session::qt_metacall (this=0x11bf070, _c=QMetaObject::InvokeMetaMethod, _id=41, _a=0x7fffcf571490) at ./Session.moc:238
#12 0x00007fc4f9516be9 in QMetaObject::activate (sender=0x11c1470, m=<optimized out>, local_signal_index=<optimized out>, argv=0x7fffcf571490) at kernel/qobject.cpp:3566
#13 0x00007fc4f9497e6f in QProcess::finished (this=<optimized out>, _t1=0, _t2=QProcess::CrashExit) at .moc/release-shared/moc_qprocess.cpp:156
#14 0x00007fc4f949f4e6 in QProcessPrivate::_q_processDied (this=0x11c14e0) at io/qprocess.cpp:1071
#15 0x00007fc4f94dd862 in QProcessPrivate::waitForFinished (this=0x11c14e0, msecs=30000) at io/qprocess_unix.cpp:1258
#16 0x00007fc4f9497c7e in QProcess::waitForFinished (this=0x11c1470, msecs=30000) at io/qprocess.cpp:1761
#17 0x00007fc4f94980f2 in QProcess::~QProcess (this=0x11c1470, __in_chrg=<optimized out>) at io/qprocess.cpp:1156
#18 0x00007fc4fa61b449 in Konsole::Pty::~Pty (this=0x11c1470, __in_chrg=<optimized out>) at ../../src/Pty.cpp:287
#19 0x00007fc4fa626264 in Konsole::Session::~Session (this=0x11bf070, __in_chrg=<optimized out>) at ../../src/Session.cpp:837
#20 0x00007fc4fa6263f9 in Konsole::Session::~Session (this=0x11bf070, __in_chrg=<optimized out>) at ../../src/Session.cpp:839
#21 0x00007fc4f951bbd8 in QObject::event (this=0x11bf070, e=<optimized out>) at kernel/qobject.cpp:1176
#22 0x00007fc4f8888104 in notify_helper (e=0x173e220, receiver=0x11bf070, this=0xf4cb50) at kernel/qapplication.cpp:4555
#23 QApplicationPrivate::notify_helper (this=0xf4cb50, receiver=0x11bf070, e=0x173e220) at kernel/qapplication.cpp:4527
#24 0x00007fc4f888cf83 in QApplication::notify (this=0x7fffcf572090, receiver=0x11bf070, e=0x173e220) at kernel/qapplication.cpp:4416
#25 0x00007fc4f9f5d9a6 in KApplication::notify (this=0x7fffcf572090, receiver=0x11bf070, event=0x173e220) at ../../kdeui/kernel/kapplication.cpp:311
#26 0x00007fc4f95025fc in QCoreApplication::notifyInternal (this=0x7fffcf572090, receiver=0x11bf070, event=0x173e220) at kernel/qcoreapplication.cpp:876
#27 0x00007fc4f95063ca in sendEvent (event=0x173e220, receiver=0x11bf070) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231
#28 QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0xf121f0) at kernel/qcoreapplication.cpp:1500
#29 0x00007fc4f9531773 in sendPostedEvents () at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:236
#30 postEventSourceDispatch (s=<optimized out>) at kernel/qeventdispatcher_glib.cpp:279
#31 0x00007fc4f49fea5d in g_main_dispatch (context=0xf50ce0) at /build/buildd/glib2.0-2.30.0/./glib/gmain.c:2441
#32 g_main_context_dispatch (context=0xf50ce0) at /build/buildd/glib2.0-2.30.0/./glib/gmain.c:3011
#33 0x00007fc4f49ff258 in g_main_context_iterate (context=0xf50ce0, block=<optimized out>, dispatch=1, self=<optimized out>) at /build/buildd/glib2.0-2.30.0/./glib/gmain.c:3089
#34 0x00007fc4f49ff429 in g_main_context_iteration (context=0xf50ce0, may_block=1) at /build/buildd/glib2.0-2.30.0/./glib/gmain.c:3152
#35 0x00007fc4f9531b9f in QEventDispatcherGlib::processEvents (this=0xf13ad0, flags=<optimized out>) at kernel/qeventdispatcher_glib.cpp:424
#36 0x00007fc4f892d21e in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=<optimized out>) at kernel/qguieventdispatcher_glib.cpp:204
#37 0x00007fc4f95013e2 in QEventLoop::processEvents (this=<optimized out>, flags=...) at kernel/qeventloop.cpp:149
#38 0x00007fc4f9501637 in QEventLoop::exec (this=0x7fffcf572020, flags=...) at kernel/qeventloop.cpp:204
#39 0x00007fc4f95066c7 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1148
#40 0x00007fc4fac45d92 in kdemain (argc=3, argv=0x7fffcf5722e8) at ../../src/main.cpp:89
#41 0x00007fc4fa8b230d in __libc_start_main (main=0x400630 <main(int, char**)>, argc=3, ubp_av=0x7fffcf5722e8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffcf5722d8) at libc-start.c:226
#42 0x0000000000400661 in _start ()

Reported using DrKonqi
Comment 1 Jekyll Wu 2012-03-18 09:41:59 UTC
Thanks for reporting.

I can get a general idea from the backtrace why Konsole crashed in the end. However, I'm confused what (special) condition triggered that strange code flow in the first place. It would be more helpful if you can provide more information about the "closing a tab" operation:

1). What is the *initial* process running in that tab? A shell, or some other terminal appliation(vim,mc,irssi,etc)? The important thing here is the *initial* process, not the current foreground process.

2). How did you exactly "close a tab"? 

   * Use the "Close Tab" action in the menu, or its corresponding shortcut
   * Use "Ctrl+D" to exit the shell, thus closing the tab

Thanks in advance
Comment 2 Thomas Dreibholz 2012-03-19 08:51:42 UTC
Am Sonntag 18 März 2012, 09:41:59 schrieben Sie:
> https://bugs.kde.org/show_bug.cgi?id=296239
> 
> Jekyll Wu <adaptee@gmail.com> changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
> CC|                            |adaptee@gmail.com
> 
> --- Comment #1 from Jekyll Wu <adaptee@gmail.com> ---
> Thanks for reporting.
> 
> I can get a general idea from the backtrace why Konsole crashed in the end.
> However, I'm confused what (special) condition triggered that strange code
> flow in the first place. It would be more helpful if you can provide more
> information about the "closing a tab" operation:
> 
> 1). What is the *initial* process running in that tab? A shell, or some
> other terminal appliation(vim,mc,irssi,etc)? The important thing here is
> the *initial* process, not the current foreground process.

It was a bash shell (the version installed with Ubuntu 11.10).


> 2). How did you exactly "close a tab"?
> 
>    * Use the "Close Tab" action in the menu, or its corresponding shortcut
>    * Use "Ctrl+D" to exit the shell, thus closing the tab

Ctrl+D.


Best regards
Comment 3 Jekyll Wu 2012-03-23 13:18:55 UTC
Git commit d8f7fd88b08099947f2c730b877f892400585fd5 by Jekyll Wu.
Committed on 23/03/2012 at 11:18.
Pushed by jekyllwu into branch 'master'.

Make sure SLOT Session::done() is only triggered once.

For some strange reason, that slot might be triggered for the second
time when Session is being destructed. That could introduce crash.

So this is more like a workaround than a perfect fix.
FIXED-IN: 4.8.2

M  +4    -0    src/Session.cpp

http://commits.kde.org/konsole/d8f7fd88b08099947f2c730b877f892400585fd5
Comment 4 Jekyll Wu 2012-03-23 13:25:52 UTC
Git commit 0e4844a3daa8bc4def7b952e3f936f23e381f71b by Jekyll Wu.
Committed on 23/03/2012 at 12:17.
Pushed by jekyllwu into branch 'KDE/4.8'.

Make sure SLOT Session::done() is only triggered once.

For some strange reason, that slot might be triggered for the second
time when Session is being destructed. That could introduce crash.

So this is more like a workaround than a perfect fix.
FIXED-IN: 4.8.2

M  +4    -0    src/Session.cpp

http://commits.kde.org/konsole/0e4844a3daa8bc4def7b952e3f936f23e381f71b