Bug 124129 - Segmentation fault killing a bash session from another session
Summary: Segmentation fault killing a bash session from another session
Status: RESOLVED FIXED
Alias: None
Product: yakuake
Classification: Applications
Component: general (show other bugs)
Version: 2.7.5
Platform: Ubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: Eike Hein
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-23 13:50 UTC by 81joe81
Modified: 2006-10-29 16:42 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description 81joe81 2006-03-23 13:50:53 UTC
Version:           2.7.5 (using KDE KDE 3.5.1)
Installed from:    Ubuntu Packages
OS:                Linux

I was trying to kill a bash session inside yakuake, typing the command kill -9 pidbash from another yakuake session, and I encountered a segmentation fault with this backtrace:

Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".
`system-supplied DSO at 0xffffe000' has disappeared; keeping its symbols.
[Thread debugging using libthread_db enabled]
[New Thread -1227868480 (LWP 14188)]
[KCrash handler]
#6  0xb780dad0 in QString::setLength () from /usr/lib/libqt-mt.so.3
#7  0xb780de28 in QString::grow () from /usr/lib/libqt-mt.so.3
#8  0xb780f789 in QString::operator+= () from /usr/lib/libqt-mt.so.3
#9  0x08058354 in TitleBar::setTitleText ()
#10 0x0805334f in MainWindow::slotSelectSession ()
#11 0x080571f4 in MainWindow::qt_invoke ()
#12 0xb74f6929 in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#13 0xb74f7238 in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#14 0x0805a570 in TabsBar::itemSelected ()
#15 0x0805a6e1 in TabsBar::qt_invoke ()
#16 0xb74f6929 in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#17 0xb74f7238 in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#18 0x0805c16d in TabbedWidget::itemSelected ()
#19 0x0805d66e in TabbedWidget::removeItem ()
#20 0x080533d7 in MainWindow::slotSessionDestroyed ()
#21 0x0805702c in MainWindow::qt_invoke ()
#22 0xb74f6929 in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#23 0xb74f73c4 in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#24 0xb7854998 in QObject::destroyed () from /usr/lib/libqt-mt.so.3
#25 0xb74f5515 in QObject::~QObject () from /usr/lib/libqt-mt.so.3
#26 0x0805e399 in ShellSession::~ShellSession ()
#27 0x0805e4b9 in ShellSession::qt_invoke ()
#28 0xb74f6a56 in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#29 0xb74f73c4 in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#30 0xb7854998 in QObject::destroyed () from /usr/lib/libqt-mt.so.3
#31 0xb74f5515 in QObject::~QObject () from /usr/lib/libqt-mt.so.3
#32 0xb6a13c77 in KParts::Part::~Part () from /usr/lib/libkparts.so.2
#33 0xb6a1a7bb in KParts::ReadOnlyPart::~ReadOnlyPart ()
   from /usr/lib/libkparts.so.2
#34 0xb6a6bf2f in konsolePart::~konsolePart ()
   from /usr/lib/kde3/libkonsolepart.so
#35 0xb6a59e0e in konsolePart::sessionDestroyed ()
   from /usr/lib/kde3/libkonsolepart.so
#36 0xb6a80182 in konsolePart::qt_invoke ()
   from /usr/lib/kde3/libkonsolepart.so
#37 0xb74f6929 in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#38 0xb74f73c4 in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#39 0xb7854998 in QObject::destroyed () from /usr/lib/libqt-mt.so.3
#40 0xb74f5515 in QObject::~QObject () from /usr/lib/libqt-mt.so.3
#41 0xb6a72e59 in TESession::~TESession ()
   from /usr/lib/kde3/libkonsolepart.so
#42 0xb6a59db6 in TESession::terminate () from /usr/lib/kde3/libkonsolepart.so
#43 0xb6a5a1e2 in konsolePart::doneSession ()
   from /usr/lib/kde3/libkonsolepart.so
#44 0xb6a8016a in konsolePart::qt_invoke ()
   from /usr/lib/kde3/libkonsolepart.so
#45 0xb74f6929 in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#46 0xb6a61dbd in TESession::done () from /usr/lib/kde3/libkonsolepart.so
#47 0xb6a72ee4 in TESession::done () from /usr/lib/kde3/libkonsolepart.so
#48 0xb6a7ba74 in TESession::qt_invoke () from /usr/lib/kde3/libkonsolepart.so
#49 0xb74f6929 in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#50 0xb74f7238 in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#51 0xb6a5e048 in TEPty::done () from /usr/lib/kde3/libkonsolepart.so
#52 0xb6a5e076 in TEPty::donePty () from /usr/lib/kde3/libkonsolepart.so
#53 0xb6a6b110 in TEPty::qt_invoke () from /usr/lib/kde3/libkonsolepart.so
#54 0xb74f6929 in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#55 0xb7b4944a in KProcess::processExited () from /usr/lib/libkdecore.so.4
#56 0xb7b494bb in KProcess::processHasExited () from /usr/lib/libkdecore.so.4
#57 0xb7b43076 in KProcessController::slotDoHousekeeping ()
   from /usr/lib/libkdecore.so.4
#58 0xb7b4318e in KProcessController::qt_invoke ()
   from /usr/lib/libkdecore.so.4
#59 0xb74f6929 in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#60 0xb74f7238 in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#61 0xb7856c67 in QSocketNotifier::activated () from /usr/lib/libqt-mt.so.3
#62 0xb7516faa in QSocketNotifier::event () from /usr/lib/libqt-mt.so.3
#63 0xb748df80 in QApplication::internalNotify () from /usr/lib/libqt-mt.so.3
#64 0xb748e172 in QApplication::notify () from /usr/lib/libqt-mt.so.3
#65 0xb7bef0cc in KApplication::notify () from /usr/lib/libkdecore.so.4
#66 0xb741edb7 in QApplication::sendEvent () from /usr/lib/libqt-mt.so.3
#67 0xb747facb in QEventLoop::activateSocketNotifiers ()
   from /usr/lib/libqt-mt.so.3
#68 0xb7432a60 in QEventLoop::processEvents () from /usr/lib/libqt-mt.so.3
#69 0xb74a5cfb in QEventLoop::enterLoop () from /usr/lib/libqt-mt.so.3
#70 0xb74a5c1e in QEventLoop::exec () from /usr/lib/libqt-mt.so.3
#71 0xb748cc13 in QApplication::exec () from /usr/lib/libqt-mt.so.3
#72 0x080525a0 in main ()
Comment 1 Eike Hein 2006-04-30 21:51:01 UTC
Heads up: I've finally been able to reproduce this locally; I'm working on a fix for the next release.
Comment 2 Eike Hein 2006-10-29 16:42:13 UTC
SVN commit 600111 by hein:

Fix crash when kpart in a tab other than 
the currently selected tab goes down.
BUG:124129


 M  +4 -0      ChangeLog  
 M  +9 -5      src/main_window.cpp  
 M  +1 -1      src/main_window.h  
 M  +3 -0      src/shell_session.cpp  
 M  +6 -0      src/shell_session.h  


--- trunk/extragear/utils/yakuake/ChangeLog #600110:600111
@@ -1,3 +1,7 @@
+Changes since 2.7.5
+- Fix crash when kpart in a tab other than the currently selected tab
+  is destroyed.
+
 Changes since 2.7.4
 - Further translations have been added.
 - Yakuake no longer spawns login shells in new sessions.
--- trunk/extragear/utils/yakuake/src/main_window.cpp #600110:600111
@@ -487,7 +487,9 @@
 
         sessions_stack.insert(index, session);
 
-        connect(session, SIGNAL(destroyed()), this, SLOT(slotSessionDestroyed()));
+        session->setId(index);
+
+        connect(session, SIGNAL(destroyed(int)), this, SLOT(slotSessionDestroyed(int)));
         connect(session, SIGNAL(titleUpdated()), this, SLOT(slotUpdateTitle()));
 
         return  index;
@@ -813,20 +815,22 @@
 ** Recreates the konsole kpart
 ********************************/
 
-void    MainWindow::slotSessionDestroyed()
+void    MainWindow::slotSessionDestroyed(int id)
 {
     if (isShuttingDown)
         return;
 
-    QWidget* widget = widgets_stack->widget(selected_id);
+    int session_id = (id != -1) ? id : selected_id;
 
+    QWidget* widget = widgets_stack->widget(session_id);
+
     if (widget == 0L)
         return;
 
     widgets_stack->removeWidget(widget);
-    sessions_stack.remove(selected_id);
+    sessions_stack.remove(session_id);
 
-    if (tabs_bar->removeItem(selected_id) == -1)
+    if (tabs_bar->removeItem(session_id) == -1)
         slotAddSession();
 }
 
--- trunk/extragear/utils/yakuake/src/main_window.h #600110:600111
@@ -206,7 +206,7 @@
 
     void    slotIncreaseHeight();
     void    slotDecreaseHeight();
-    void    slotSessionDestroyed();
+    void    slotSessionDestroyed(int id = -1);
 
     void    slotSetAccessKey();
     void    slotSetControlKeys();
--- trunk/extragear/utils/yakuake/src/shell_session.cpp #600110:600111
@@ -30,6 +30,7 @@
     session_title = "";
     session_widget = NULL;
     session_terminal = NULL;
+    session_id = -1;
 
 
     if ((factory = KLibLoader::self()->factory("libkonsolepart")) != NULL)
@@ -73,6 +74,8 @@
 
 void    ShellSession::slotDestroySession()
 {
+    emit destroyed(session_id);
+
     delete this;
 }
 
--- trunk/extragear/utils/yakuake/src/shell_session.h #600110:600111
@@ -42,6 +42,9 @@
 {
     Q_OBJECT
 
+private:
+    int session_id;
+
 public:
 
     //-- PRIVATE ATTRIBUTES ---------------------------------------------//
@@ -67,6 +70,8 @@
 
     //-- PUBLIC METHODS -------------------------------------------------//
 
+    void setId(int id) { session_id = id; }
+    int id() { return session_id; }
 
 
 public slots:
@@ -83,6 +88,7 @@
     //-- SIGNALS DEFINITION ---------------------------------------------//
 
     void    titleUpdated();
+    void    destroyed(int id);
 };
 
 #endif /* SHELL_SESSION_H */