Bug 72582 - Crashs while loading plugins after unloading plugins
Summary: Crashs while loading plugins after unloading plugins
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: general (show other bugs)
Version: git master
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: KDevelop Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-01-13 23:40 UTC by Sascha Cunz
Modified: 2004-01-15 22:15 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
this patch seems to fix the crash for me (504 bytes, patch)
2004-01-14 00:56 UTC, Sascha Cunz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sascha Cunz 2004-01-13 23:40:22 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
OS:          Linux

Yet another crash in kdevelop:

to reproduce:
a)
  - unload all global plugins
  - unload all project plugins
  - load all project plugins

or b) according to Jens Dagerbo shorter way to the same(?) crash:
  - unload globals
  - load a project (that has all plugins enabled) 

[New Thread 16384 (LWP 12392)]
[New Thread 32769 (LWP 12396)]
[New Thread 16386 (LWP 12397)]
0x4177f178 in waitpid () from /lib/libpthread.so.0
#0  0x4177f178 in waitpid () from /lib/libpthread.so.0
#1  0x40e242b0 in KCrash::defaultCrashHandler(int) (sig=11) at kcrash.cpp:246
#2  0x4177dfea in __pthread_sighandler () from /lib/libpthread.so.0
#3  <signal handler called>
#4  0x425773ad in PartWidget (this=0xbfffd85c, part=0xbfffd8e0, parent=0x0)
    at partwidget.cpp:78
#5  0x425714e7 in FileViewPart (this=0x86dc0c8, parent=0xfffffe00, name=0x0)
    at qguardedptr.h:93
#6  0x42572a87 in KGenericFactory<FileViewPart, QObject>::createObject(QObject*, char const*, char const*, QStringList const&) (this=0xfffffe00, 
    parent=0xfffffe00, name=0xfffffe00 <Address 0xfffffe00 out of bounds>, 
    className=0x4064702c "KDevPlugin", args=@0xfffffe00)
    at kgenericfactory.tcc:165
#7  0x40e3f891 in KLibFactory::create(QObject*, char const*, char const*, QStringList const&) (this=0x892d240, parent=0xfffffe00, 
    name=0xfffffe00 <Address 0xfffffe00 out of bounds>, 
    classname=0xfffffe00 <Address 0xfffffe00 out of bounds>, args=@0xfffffe00)
    at klibloader.cpp:93
#8  0x0807d2da in createInstanceFromFactory<KDevPlugin> (factory=0xfffffe00, 
    parent=0xfffffe00, name=0xfffffe00 <Address 0xfffffe00 out of bounds>, 
    args=@0xfffffe00) at qmetaobject.h:164
#9  0x0807cf87 in createInstanceFromLibrary<KDevPlugin> (libraryName=0x0, 
    parent=0xfffffe00, name=0xfffffe00 <Address 0xfffffe00 out of bounds>, 
    args=@0xfffffe00, error=0x892d240) at componentfactory.h:144
#10 0x0807cb79 in createInstanceFromService<KDevPlugin> (service=@0xfffffe00, 
    parent=0xfffffe00, name=0xfffffe00 <Address 0xfffffe00 out of bounds>, 
    args=@0xfffffe00, error=0x892d240) at qmemarray.h:64
#11 0x0807c766 in PluginController::loadPlugin(KSharedPtr<KService> const&) (
    service=@0x0) at plugincontroller.cpp:246
#12 0x08079066 in ProjectManager::loadLocalParts() (this=0x892d240)
    at qvaluelist.h:186
#13 0x08079f53 in ProjectManager::qt_invoke(int, QUObject*) (this=0x81bb4b0, 
    _id=7, _o=0xbfffdf10) at projectmanager.moc:119
#14 0x411ed210 in QObject::activate_signal(QConnectionList*, QUObject*) ()
   from /opt/qt3/lib/libqt-mt.so.3
#15 0x411ed044 in QObject::activate_signal(int) ()
   from /opt/qt3/lib/libqt-mt.so.3
#16 0x0807f8ed in PartSelectWidget::accepted() (this=0xfffffe00)
    at qmetaobject.h:261
#17 0x0807f97c in PartSelectWidget::qt_invoke(int, QUObject*) (this=0x8370ec0, 
    _id=45, _o=0xbfffdff0) at partselectwidget.moc:102
#18 0x411ed188 in QObject::activate_signal(QConnectionList*, QUObject*) ()
   from /opt/qt3/lib/libqt-mt.so.3
#19 0x411ed044 in QObject::activate_signal(int) ()
   from /opt/qt3/lib/libqt-mt.so.3
#20 0x40bdc03e in KDialogBase::okClicked() (this=0xfffffe00)
    at qmetaobject.h:261
#21 0x40bd9bc2 in KDialogBase::slotOk() (this=0xbfffea30)
    at kdialogbase.cpp:1167
#22 0x40bdc557 in KDialogBase::qt_invoke(int, QUObject*) (this=0xbfffea30, 
    _id=73, _o=0xbfffea30) at kdialogbase.moc:359
#23 0x411ed210 in QObject::activate_signal(QConnectionList*, QUObject*) ()
   from /opt/qt3/lib/libqt-mt.so.3
#24 0x411ed044 in QObject::activate_signal(int) ()
   from /opt/qt3/lib/libqt-mt.so.3
#25 0x4150d7ae in QButton::clicked() () from /opt/qt3/lib/libqt-mt.so.3
#26 0x412790aa in QButton::mouseReleaseEvent(QMouseEvent*) ()
   from /opt/qt3/lib/libqt-mt.so.3
#27 0x412219ac in QWidget::event(QEvent*) () from /opt/qt3/lib/libqt-mt.so.3
#28 0x411923a5 in QApplication::internalNotify(QObject*, QEvent*) ()
   from /opt/qt3/lib/libqt-mt.so.3
#29 0x41191888 in QApplication::notify(QObject*, QEvent*) ()
   from /opt/qt3/lib/libqt-mt.so.3
#30 0x40d8334c in KApplication::notify(QObject*, QEvent*) (this=0xbffff670, 
    receiver=0x8275650, event=0xbfffe5a0) at kapplication.cpp:503
#31 0x4112adb8 in QETWidget::translateMouseEvent(_XEvent const*) ()
   from /opt/qt3/lib/libqt-mt.so.3
#32 0x41128549 in QApplication::x11ProcessEvent(_XEvent*) ()
   from /opt/qt3/lib/libqt-mt.so.3
#33 0x4113ee77 in QEventLoop::processEvents(unsigned) ()
   from /opt/qt3/lib/libqt-mt.so.3
#34 0x411a5606 in QEventLoop::enterLoop() () from /opt/qt3/lib/libqt-mt.so.3
#35 0x41192651 in QApplication::enter_loop() () from /opt/qt3/lib/libqt-mt.so.3
#36 0x4136a541 in QDialog::exec() () from /opt/qt3/lib/libqt-mt.so.3
#37 0x08075ed9 in ProjectManager::slotProjectOptions() (this=0x81bb4b0)
    at projectmanager.cpp:175
#38 0x08079f49 in ProjectManager::qt_invoke(int, QUObject*) (this=0xbfffea30, 
    _id=1097002164, _o=0xbfffeba0) at projectmanager.moc:118
#39 0x411ed210 in QObject::activate_signal(QConnectionList*, QUObject*) ()
   from /opt/qt3/lib/libqt-mt.so.3
#40 0x411ed044 in QObject::activate_signal(int) ()
   from /opt/qt3/lib/libqt-mt.so.3
#41 0x40b4055b in KAction::activated() (this=0xfffffe00) at qmetaobject.h:261
#42 0x40b3fb2f in KAction::slotActivated() (this=0xfffffe00)
    at kaction.cpp:1054
#43 0x40b40761 in KAction::qt_invoke(int, QUObject*) (this=0x81bd8c8, _id=14, 
    _o=0xbfffeca0) at kaction.moc:181
#44 0x411ed210 in QObject::activate_signal(QConnectionList*, QUObject*) ()
   from /opt/qt3/lib/libqt-mt.so.3
#45 0x41507262 in QSignal::signal(QVariant const&) ()
   from /opt/qt3/lib/libqt-mt.so.3
#46 0x41207148 in QSignal::activate() () from /opt/qt3/lib/libqt-mt.so.3
#47 0x412ebe9d in QPopupMenu::mouseReleaseEvent(QMouseEvent*) ()
   from /opt/qt3/lib/libqt-mt.so.3
#48 0x412219ac in QWidget::event(QEvent*) () from /opt/qt3/lib/libqt-mt.so.3
#49 0x411923a5 in QApplication::internalNotify(QObject*, QEvent*) ()
   from /opt/qt3/lib/libqt-mt.so.3
#50 0x41191888 in QApplication::notify(QObject*, QEvent*) ()
   from /opt/qt3/lib/libqt-mt.so.3
#51 0x40d8334c in KApplication::notify(QObject*, QEvent*) (this=0xbffff670, 
    receiver=0x81e1928, event=0xbffff1e0) at kapplication.cpp:503
#52 0x4112a99d in QETWidget::translateMouseEvent(_XEvent const*) ()
   from /opt/qt3/lib/libqt-mt.so.3
#53 0x41128549 in QApplication::x11ProcessEvent(_XEvent*) ()
   from /opt/qt3/lib/libqt-mt.so.3
#54 0x4113ee77 in QEventLoop::processEvents(unsigned) ()
   from /opt/qt3/lib/libqt-mt.so.3
#55 0x411a5606 in QEventLoop::enterLoop() () from /opt/qt3/lib/libqt-mt.so.3
#56 0x411a54a8 in QEventLoop::exec() () from /opt/qt3/lib/libqt-mt.so.3
#57 0x411925f1 in QApplication::exec() () from /opt/qt3/lib/libqt-mt.so.3
#58 0x08062861 in main (argc=-512, argv=0xfffffe00) at main.cpp:128
#59 0x418d590c in __libc_start_main () from /lib/libc.so.6
Comment 1 Sascha Cunz 2004-01-14 00:56:33 UTC
Created attachment 4154 [details]
this patch seems to fix the crash for me
Comment 2 Jens Dagerbo 2004-01-14 01:03:36 UTC
Yup. Loading the FileTree plugin after having had either global VCS plugin loaded produces this crash. Sascha's patch fixes it.
Comment 3 Alexander Dymo 2004-01-15 22:15:53 UTC
Subject: kdevelop

CVS commit by dymo: 

Commited patches to fix 
#72582 Crashes while loading plugins after unloading plugins
#72502 Kdevelop crashes when closing multiple files via Keyboard 

CCMAIL: 72582-done@bugs.kde.org
CCMAIL: 72502-done@bugs.kde.org


  M +2 -0      lib/interfaces/kdevapi.cpp   1.11
  M +15 -24    parts/bookmarks/bookmarks_part.cpp   1.18


--- kdevelop/parts/bookmarks/bookmarks_part.cpp  #1.17:1.18
@@ -151,7 +151,7 @@ void BookmarksPart::marksChanged()
         {
                 KParts::ReadOnlyPart * ro_part = *it;
-                KTextEditor::MarkInterface * mi = dynamic_cast<KTextEditor::MarkInterface*>( ro_part );
-        
-                if ( ro_part && mi && partIsSane( ro_part ) )
+                if ( partIsSane( ro_part ) )
+                {
+                        if ( dynamic_cast<KTextEditor::MarkInterface*>( ro_part ) )
                 {
                         if ( EditorData * data = storeBookmarksForURL( ro_part ) )
@@ -165,4 +165,5 @@ void BookmarksPart::marksChanged()
                         }
                 }
+                }
                 ++it;
         }
@@ -505,17 +506,7 @@ KParts::ReadOnlyPart * BookmarksPart::pa
 bool BookmarksPart::partIsSane( KParts::ReadOnlyPart * ro_part )
 {
-        //kdDebug(0) << "BookmarksPart::partIsSane()" << endl;
-        
-        bool isSane = true;
-        
-        isSane = isSane && partController()->parts()->contains( ro_part);
-        isSane = isSane && !ro_part->url().path().isEmpty();
-        
-        if ( ! isSane )
-        {
-                //kdDebug(0) << " ** Non-sane part encountered! ** " << endl;
-        }
-        
-        return isSane;
+        return ( ro_part != 0 ) && 
+                        partController()->parts()->contains( ro_part) &&
+                        !ro_part->url().path().isEmpty();
 }
 

--- kdevelop/lib/interfaces/kdevapi.cpp  #1.10:1.11
@@ -157,4 +157,6 @@ void KDevApi::registerVersionControl( KD
 void KDevApi::unregisterVersionControl( KDevVersionControl *vcs )
 {
+    if( vcs == d->m_versionControl )
+        setVersionControl( 0 );
     d->m_registeredVcs.remove( vcs->uid() );
 }