Bug 60500

Summary: Crash in EditorProxy::installPopup while single stepping
Product: [Applications] kdevelop Reporter: Jon Smirl <jonsmirl>
Component: generalAssignee: KDevelop Developers <kdevelop-devel>
Status: RESOLVED FIXED    
Severity: crash    
Priority: NOR    
Version: git master   
Target Milestone: ---   
Platform: RedHat Enterprise Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Jon Smirl 2003-06-29 21:47:41 UTC
Version:           CVS (using KDE KDE 3.1)
Installed from:    RedHat RPMs

I was just clicking the step button and not doing anything else special. I use the QtEditor.

[New Thread 1096311936 (LWP 2303)]
[New Thread 1116949808 (LWP 2304)]
0xffffe410 in ?? ()
#0  0xffffe410 in ?? ()
#1  0x40a1557d in KCrash::defaultCrashHandler(int) ()
   from /usr/lib/libkdecore.so.4
#2  <signal handler called>
#3  0x40da7d67 in QObject::connect(QObject const*, char const*, QObject const*, char const*) () from /usr/lib/qt-3.1/lib/libqt-mt.so.3
#4  0x08088817 in EditorProxy::installPopup(KParts::Part*, QPopupMenu*) ()
#5  0x08076cff in PartController::integratePart(KParts::Part*, KURL const&, bool) ()
#6  0x080754f0 in PartController::editDocument(KURL const&, int, int) ()
#7  0x08089fc1 in Debugger::gotoExecutionPoint(KURL const&, int) ()
#8  0x41d974e8 in GDBDebugger::DebuggerPart::slotShowStep(QString const&, int)
    () from /opt/kde3/lib/kde3/libkdevdebugger.so
#9  0x41d979ed in GDBDebugger::DebuggerPart::qt_invoke(int, QUObject*) ()
   from /opt/kde3/lib/kde3/libkdevdebugger.so
#10 0x40da9040 in QObject::activate_signal(QConnectionList*, QUObject*) ()
   from /usr/lib/qt-3.1/lib/libqt-mt.so.3
#11 0x41da3348 in GDBDebugger::GDBController::showStepInSource(QString const&, int, QString const&) () from /opt/kde3/lib/kde3/libkdevdebugger.so
#12 0x41d9e0af in GDBDebugger::GDBController::parseProgramLocation(char*) ()
   from /opt/kde3/lib/kde3/libkdevdebugger.so
#13 0x41d9eb77 in GDBDebugger::GDBController::parseCmdBlock(char*) ()
   from /opt/kde3/lib/kde3/libkdevdebugger.so
#14 0x41d9edca in GDBDebugger::GDBController::parse(char*) ()
   from /opt/kde3/lib/kde3/libkdevdebugger.so
#15 0x41da2300 in GDBDebugger::GDBController::slotDbgStdout(KProcess*, char*, int) () from /opt/kde3/lib/kde3/libkdevdebugger.so
#16 0x41da3c22 in GDBDebugger::GDBController::qt_invoke(int, QUObject*) ()
   from /opt/kde3/lib/kde3/libkdevdebugger.so
#17 0x40da90c9 in QObject::activate_signal(QConnectionList*, QUObject*) ()
   from /usr/lib/qt-3.1/lib/libqt-mt.so.3
#18 0x409daad9 in KProcess::receivedStdout(KProcess*, char*, int) ()
   from /usr/lib/libkdecore.so.4
#19 0x409d96e1 in KProcess::childOutput(int) () from /usr/lib/libkdecore.so.4
#20 0x409d94d9 in KProcess::slotChildOutput(int) ()
   from /usr/lib/libkdecore.so.4
#21 0x409dae46 in KProcess::qt_invoke(int, QUObject*) ()
   from /usr/lib/libkdecore.so.4
#22 0x40da90c9 in QObject::activate_signal(QConnectionList*, QUObject*) ()
   from /usr/lib/qt-3.1/lib/libqt-mt.so.3
#23 0x40da91a5 in QObject::activate_signal(int, int) ()
   from /usr/lib/qt-3.1/lib/libqt-mt.so.3
#24 0x41089282 in QSocketNotifier::activated(int) ()
   from /usr/lib/qt-3.1/lib/libqt-mt.so.3
#25 0x40dc54b0 in QSocketNotifier::event(QEvent*) ()
   from /usr/lib/qt-3.1/lib/libqt-mt.so.3
#26 0x40d4af24 in QApplication::internalNotify(QObject*, QEvent*) ()
   from /usr/lib/qt-3.1/lib/libqt-mt.so.3
#27 0x40d4ab19 in QApplication::notify(QObject*, QEvent*) ()
   from /usr/lib/qt-3.1/lib/libqt-mt.so.3
#28 0x409a91e9 in KApplication::notify(QObject*, QEvent*) ()
   from /usr/lib/libkdecore.so.4
#29 0x40d25efa in QEventLoop::activateSocketNotifiers() ()
   from /usr/lib/qt-3.1/lib/libqt-mt.so.3
#30 0x40d038d7 in QEventLoop::processEvents(unsigned) ()
   from /usr/lib/qt-3.1/lib/libqt-mt.so.3
#31 0x40d5ecf6 in QEventLoop::enterLoop() ()
   from /usr/lib/qt-3.1/lib/libqt-mt.so.3
#32 0x40d5eb98 in QEventLoop::exec() () from /usr/lib/qt-3.1/lib/libqt-mt.so.3
#33 0x40d4b151 in QApplication::exec() ()
   from /usr/lib/qt-3.1/lib/libqt-mt.so.3
#34 0x0806cfd3 in main ()
#35 0x420156a4 in __libc_start_main () from /lib/tls/libc.so.6
Comment 1 Jens Dagerbo 2003-11-03 02:33:14 UTC
Confirmed, I (probably) just ran into this one while doing something completely different.

Backtrace:
[New Thread 16384 (LWP 30940)]
[New Thread 32769 (LWP 31125)]
[New Thread 49154 (LWP 3883)]
0x4188039c in waitpid () from /lib/libpthread.so.0
#0  0x4188039c in waitpid () from /lib/libpthread.so.0
#1  0x40ddcb70 in KCrash::defaultCrashHandler(int) ()
   from /opt/kde/lib/libkdecore.so.4
#2  0x4187f17c in __pthread_sighandler () from /lib/libpthread.so.0
#3  <signal handler called>
#4  0x411a3b67 in QObject::connect(QObject const*, char const*, QObject const*, char const*) () from /opt/qt-3.2.1/lib/libqt-mt.so.3
#5  0x0808d64a in EditorProxy::installPopup(KParts::Part*, QPopupMenu*) (
    this=0x8866710, part=0x8c2e7e0, popup=0x82110e0) at editorproxy.cpp:64
#6  0x08075ccf in PartController::integratePart(KParts::Part*, KURL const&, bool) (this=0x8197a90, part=0x8c2e7e0, url=@0xbfffe770, isTextEditor=true)
    at partcontroller.cpp:445
#7  0x0807543f in PartController::editDocument(KURL const&, int, int) (
    this=0x8197a90, inputUrl=@0xbfffe890, lineNum=147, col=-1)
    at partcontroller.cpp:344
#8  0x08093baf in ProjectSession::recreateViews(KURL&, QDomElement) (
    this=0x81d6d98, url=@0xbfffe890, docEl=<incomplete type>)
    at projectsession.cpp:186
#9  0x080937de in ProjectSession::recreateDocs(QDomElement&) (this=0x81d6d98, 
    el=@0xbfffe970) at projectsession.cpp:146
#10 0x08093370 in ProjectSession::restoreFromFile(QString const&, QDict<KDevPlugin> const&) (this=0x81d6d98, sessionFileName=@0xbfffeac0, 
    projectPlugins=@0xbfffeae0) at projectsession.cpp:101
#11 0x0807c739 in ProjectManager::loadProject(KURL const&) (this=0x81d69d8, 
    url=@0xbfffec10) at projectmanager.cpp:295
#12 0x0807f384 in ProjectManager::qt_invoke(int, QUObject*) (this=0x81d69d8, 
    _id=2, _o=0xbfffebb0) at projectmanager.moc:114
#13 0x411a4f80 in QObject::activate_signal(QConnectionList*, QUObject*) ()
   from /opt/qt-3.2.1/lib/libqt-mt.so.3
#14 0x40b07dd2 in KRecentFilesAction::urlSelected(KURL const&) ()
   from /opt/kde/lib/libkdeui.so.4
#15 0x40affcb0 in KRecentFilesAction::itemSelected(QString const&) ()
   from /opt/kde/lib/libkdeui.so.4
#16 0x40b07f87 in KRecentFilesAction::qt_invoke(int, QUObject*) ()
   from /opt/kde/lib/libkdeui.so.4
#17 0x411a4f80 in QObject::activate_signal(QConnectionList*, QUObject*) ()
   from /opt/qt-3.2.1/lib/libqt-mt.so.3
#18 0x411a5440 in QObject::activate_signal(int, QString) ()
   from /opt/qt-3.2.1/lib/libqt-mt.so.3
#19 0x40b07455 in KSelectAction::activated(QString const&) ()
   from /opt/kde/lib/libkdeui.so.4
#20 0x40b001d5 in KRecentFilesAction::slotActivated() ()
   from /opt/kde/lib/libkdeui.so.4
#21 0x40b08005 in KRecentFilesAction::qt_invoke(int, QUObject*) ()
   from /opt/kde/lib/libkdeui.so.4
#22 0x411a4f80 in QObject::activate_signal(QConnectionList*, QUObject*) ()
   from /opt/qt-3.2.1/lib/libqt-mt.so.3
#23 0x414bc202 in QSignal::signal(QVariant const&) ()
   from /opt/qt-3.2.1/lib/libqt-mt.so.3
#24 0x411bef18 in QSignal::activate() () from /opt/qt-3.2.1/lib/libqt-mt.so.3
#25 0x411c6493 in QSingleShotTimer::event(QEvent*) ()
   from /opt/qt-3.2.1/lib/libqt-mt.so.3
#26 0x4114a1e5 in QApplication::internalNotify(QObject*, QEvent*) ()
   from /opt/qt-3.2.1/lib/libqt-mt.so.3
#27 0x4114989b in QApplication::notify(QObject*, QEvent*) ()
   from /opt/qt-3.2.1/lib/libqt-mt.so.3
#28 0x40d35b2e in KApplication::notify(QObject*, QEvent*) ()
   from /opt/kde/lib/libkdecore.so.4
#29 0x41139c0d in QEventLoop::activateTimers() ()
   from /opt/qt-3.2.1/lib/libqt-mt.so.3
#30 0x410f7254 in QEventLoop::processEvents(unsigned) ()
   from /opt/qt-3.2.1/lib/libqt-mt.so.3
#31 0x4115d3f6 in QEventLoop::enterLoop() ()
   from /opt/qt-3.2.1/lib/libqt-mt.so.3
#32 0x4115d298 in QEventLoop::exec() () from /opt/qt-3.2.1/lib/libqt-mt.so.3
#33 0x4114a431 in QApplication::exec() () from /opt/qt-3.2.1/lib/libqt-mt.so.3
#34 0x08069fbf in main (argc=1, argv=0xbffff534) at main.cpp:128
#35 0x419f3b47 in __libc_start_main () from /lib/libc.so.6
Comment 2 Jens Dagerbo 2003-11-03 14:11:28 UTC
Fixed in CVS by Sascha Cunz. Thanks! :)

His explanation:
[snip]
In fact, it was a problem with the context menu of the editor part.

PartController creates a KPopupMenu from the XML-GUI. This one was staticly stored in PartController::contextPopupMenu(). This KPopupMenu seems to be owned by the XML-GUI.

This menu gets propagated into each editor on opening. At this point, 
EditorProxy connects to the menu's aboutToShow.

When the Popup is now about to show, EditorProxy cleans it completely. Then it asks all around KDevelop to fill the menu. ( There was  a bug in this 
cleaning, i fixed it: now the menuitems contained in kdevelopui.rc at 
"rb_popup" are also shown in the editor's context menu )

After a manual change of the XML-GUI via KEditToolBar-Dialog, the KPopupMenu stored in the editors is invalid. So opening the next file causes a try to connect a slot to a deleted object.

I changed PartController::contextPopupMenu, so that it does not cache the pointer from XML-GUI anymore. This makes opening new files work again.

Now another bug came into front: If one chages a toolbar, the KPopupMenus "installed" into existing editor parts get invalid. I added code to reinstall them after the toolbar has been changed.
[snip]
Comment 3 Jens Dagerbo 2003-11-03 18:06:06 UTC
*** Bug 62391 has been marked as a duplicate of this bug. ***