Bug 113409 - Crash on exit
Summary: Crash on exit
Status: RESOLVED FIXED
Alias: None
Product: akregator
Classification: Applications
Component: general (show other bugs)
Version: cvs
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-27 07:58 UTC by Frank Osterfeld
Modified: 2005-10-22 12:29 UTC (History)
0 users

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 Frank Osterfeld 2005-09-27 07:58:12 UTC
3.5 branch, SVN Revision: 457037 
 
Crash when disconnecting nodes. I am not sure, maybe this is because I deleted 
some feeds from the list (did some minor feed list restructuring). 
 
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 -1242250592 (LWP 28482)]  
[KCrash handler]  
#4  0x00000049 in ?? ()  
#5  0xb7f9de27 in Akregator::TreeNodeVisitor::visit (this=0x8220130,   
    node=0x8c69580) at treenodevisitor.cpp:32  
#6  0xb5c3fb88 in Akregator::NodeListView::disconnectFromNode (this=0x821bfe0,   
    node=0x8c69580) at feedlistview.cpp:966  
#7  0xb5c3de78 in Akregator::NodeListView::clear (this=0x821bfe0)  
    at feedlistview.cpp:480  
#8  0xb5c3d9c1 in Akregator::NodeListView::setNodeList (this=0x821bfe0,   
    nodeList=0x0) at feedlistview.cpp:387  
#9  0xb5c57a3d in Akregator::View::slotOnShutdown (this=0x8211508)  
    at akregator_view.cpp:397  
#10 0xb5c4ea19 in Akregator::Part::slotOnShutdown (this=0x81a9a10)  
    at akregator_part.cpp:227  
#11 0xb5c4f214 in ~Part (this=0x81a9a10) at akregator_part.cpp:266  
#12 0x080535c1 in Akregator::MainWindow::queryExit (this=0x8063a98)  
    at mainwindow.cpp:240  
#13 0xb6f94cc9 in KMainWindow::shuttingDown (this=0x8c695ec)  
    at kmainwindow.cpp:1104  
#14 0xb6f95794 in KMainWindow::qt_invoke (this=0x8063a98, _id=71,   
    _o=0xbffff410) at kmainwindow.moc:139  
#15 0xb7538101 in KParts::MainWindow::qt_invoke (this=0x8063a98, _id=71,   
    _o=0xbffff410) at mainwindow.moc:98  
#16 0x08053b33 in Akregator::MainWindow::qt_invoke (this=0x8063a98, _id=71,   
    _o=0xbffff410) at mainwindow.moc:175  
#17 0xb664cfdd in QObject::activate_signal ()  
   from /usr/share/qt3/lib/libqt-mt.so.3  
#18 0xb664ceae in QObject::activate_signal ()  
   from /usr/share/qt3/lib/libqt-mt.so.3  
#19 0xb6c1c9be in KApplication::shutDown (this=0x49) at qmetaobject.h:261  
#20 0xb6c1cc55 in KApplication::qt_emit (this=0xbffff5f0, _id=15,   
    _o=0xbffff530) at kapplication.moc:270  
#21 0xb6cd0f5d in KUniqueApplication::qt_emit (this=0x49, _id=73, _o=0x49)  
    at kuniqueapplication.moc:96  
#22 0xb664d015 in QObject::activate_signal ()  
   from /usr/share/qt3/lib/libqt-mt.so.3  
#23 0xb664ceae in QObject::activate_signal ()  
   from /usr/share/qt3/lib/libqt-mt.so.3  
#24 0xb6960fbc in QApplication::aboutToQuit ()  
   from /usr/share/qt3/lib/libqt-mt.so.3  
#25 0xb660671d in QEventLoop::enterLoop ()  
   from /usr/share/qt3/lib/libqt-mt.so.3  
#26 0xb660660e in QEventLoop::exec () from /usr/share/qt3/lib/libqt-mt.so.3  
#27 0xb65f557b in QApplication::exec () from /usr/share/qt3/lib/libqt-mt.so.3  
#28 0x0805170a in main (argc=7, argv=0xbffff7b4) at main.cpp:110
Comment 1 Frank Osterfeld 2005-09-30 08:12:00 UTC
SVN commit 465550 by osterfeld:

some cleanups, *might* affect 113409 (or might not)
CCBUG: 113409


 M  +8 -10     feedlistview.cpp  


--- branches/KDE/3.5/kdepim/akregator/src/feedlistview.cpp #465549:465550
@@ -117,27 +117,25 @@
     public:
         ConnectNodeVisitor(NodeListView* view) : m_view(view) {}
 
-        virtual bool visitTagNode(TagNode* node)
+        virtual bool visitTreeNode(TreeNode* node)
         {
             connect(node, SIGNAL(signalDestroyed(TreeNode*)), m_view, SLOT(slotNodeDestroyed(TreeNode*) ));
             connect(node, SIGNAL(signalChanged(TreeNode*)), m_view, SLOT(slotNodeChanged(TreeNode*) ));
             return true;
         }
-        
+
         virtual bool visitFolder(Folder* node)
         {
+            visitTreeNode(node);
             connect(node, SIGNAL(signalChildAdded(TreeNode*)), m_view, SLOT(slotNodeAdded(TreeNode*) ));
             connect(node, SIGNAL(signalChildRemoved(Folder*, TreeNode*)), m_view, SLOT(slotNodeRemoved(Folder*, TreeNode*) ));
-            
-            connect(node, SIGNAL(signalDestroyed(TreeNode*)), m_view, SLOT(slotNodeDestroyed(TreeNode*) ));
-            connect(node, SIGNAL(signalChanged(TreeNode*)), m_view, SLOT(slotNodeChanged(TreeNode*) ));
             return true;
         }
         
         virtual bool visitFeed(Feed* node)
         {
-            connect(node, SIGNAL(signalDestroyed(TreeNode*)), m_view, SLOT(slotNodeDestroyed(TreeNode*) ));
-            connect(node, SIGNAL(signalChanged(TreeNode*)), m_view, SLOT(slotNodeChanged(TreeNode*) ));
+            visitTreeNode(node);
+            
             connect(node, SIGNAL(fetchStarted(Feed*)), m_view, SLOT(slotFeedFetchStarted(Feed*)));
             connect(node, SIGNAL(fetchAborted(Feed*)), m_view, SLOT(slotFeedFetchAborted(Feed*)));
             connect(node, SIGNAL(fetchError(Feed*)), m_view, SLOT(slotFeedFetchError(Feed*)));
@@ -978,11 +976,11 @@
 {
     TreeNodeItem* item = findNodeItem(node);
     
-    if (!node || !item)
-        return;
-    
     d->itemDict.remove(node);
 
+    if (!item)
+        return;
+    
     if ( item->isSelected() )
     {
         if (item->itemBelow())
Comment 2 Frank Osterfeld 2005-10-22 09:09:02 UTC
This still happens.

How to reproduce:

- Create a folder "foobar". 
- Import a feed from some website.
- Move feed from "imported folder" to "foobar"
- Delete "foobar" (and the added feed with it)
- Exit Akregator

=> Crash

Something goes wrong tracking the displayed nodes. It seems it has to do with moving nodes and deleting the later.
Comment 3 Frank Osterfeld 2005-10-22 12:21:24 UTC
SVN commit 472974 by osterfeld:

Don't crash on exit, when moving a node and deleting it later.
BUG: 113409


 M  +4 -21     feedlistview.cpp  
 M  +0 -3      feedlistview.h  


--- branches/KDE/3.5/kdepim/akregator/src/feedlistview.cpp #472973:472974
@@ -401,24 +401,6 @@
     slotRootNodeChanged(rootNode);
 }
 
-void NodeListView::takeNode(QListViewItem* item)
-{
-    if (item->parent())
-        item->parent()->takeItem(item);
-    else
-        takeItem(item);
-}
-
-void NodeListView::insertNode(QListViewItem* parent, QListViewItem* item, QListViewItem* after)
-{
-    if (parent)
-        parent->insertItem(item);
-    else
-        insertItem(item);
-    if (after)
-        item->moveItem(after);
-}
-
 Folder* NodeListView::rootNode()
 {
     return d->nodeList ? d->nodeList->rootNode() : 0;
@@ -923,15 +905,16 @@
 void NodeListView::slotNodeAdded(TreeNode* node)
 {
     d->createItemVisitor->visit(node);
+    kdDebug() << "NodeListView::slotNodeAdded: " << node->title() << endl;
 }
 
 void NodeListView::slotNodeRemoved(Folder* /*parent*/, TreeNode* node)
 {
     if (!node)
         return;
-    
-    disconnectFromNode(node);    
-    takeNode(findNodeItem(node));
+    kdDebug() << "NodeListView::slotNodeRemoved: " << node->title() << endl; 
+    disconnectFromNode(node);
+    delete d->itemDict.take(node);
 }
 
 void NodeListView::connectToNode(TreeNode* node)
--- branches/KDE/3.5/kdepim/akregator/src/feedlistview.h #472973:472974
@@ -134,9 +134,6 @@
     virtual bool acceptDrag(QDropEvent *event) const;
     virtual void movableDropEvent(QListViewItem* parent, QListViewItem* afterme);
 
-    void takeNode(QListViewItem* item);
-    void insertNode(QListViewItem* parent, QListViewItem* item, QListViewItem* after);
-
     virtual QDragObject *dragObject();
             
 
Comment 4 Frank Osterfeld 2005-10-22 12:29:14 UTC
SVN commit 472978 by osterfeld:

forward port of 113409 (Don't crash on exit)
CCBUG: 113409


 M  +4 -3      feedlistview.cpp  


--- trunk/KDE/kdepim/akregator/src/feedlistview.cpp #472977:472978
@@ -929,15 +929,16 @@
 void NodeListView::slotNodeAdded(TreeNode* node)
 {
     d->createItemVisitor->visit(node);
+    kdDebug() << "NodeListView::slotNodeAdded: " << node->title() << endl;
 }
 
 void NodeListView::slotNodeRemoved(Folder* /*parent*/, TreeNode* node)
 {
     if (!node)
         return;
-    
-    disconnectFromNode(node);    
-    takeNode(findNodeItem(node));
+    kdDebug() << "NodeListView::slotNodeRemoved: " << node->title() << endl; 
+    disconnectFromNode(node);
+    delete d->itemDict.take(node);
 }
 
 void NodeListView::connectToNode(TreeNode* node)