Bug 143027 - Crash when removing scalars with View Scalar Values dialog open
Summary: Crash when removing scalars with View Scalar Values dialog open
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Applications
Component: general (show other bugs)
Version: 1.x
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: kst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-15 22:32 UTC by Andrew Walker
Modified: 2007-03-16 00:32 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 Andrew Walker 2007-03-15 22:32:29 UTC
Version:           HEAD (using KDE KDE 3.5.1)
Installed from:    Compiled From Sources
OS:                Linux

PROBLEM:

When the View Scalar values dialog is open and scalar values are removed Kst will crash

STEPS TO REPRODUCE:

Start Kst
Create a single plot with a single curve
Select Data... View Scalar Values
Delete the plot created
Select Data... Data Manager
Hit the Purge button in the Data Manager

RESULTS:

Kst crashes

EXPECTED RESULTS:

The appropriate scalars are removed from the View Scalar Values dialog
Comment 1 Andrew Walker 2007-03-15 22:32:54 UTC
Using host libthread_db library "/lib/libthread_db.so.1".
`shared object read from target memory' has disappeared; keeping its symbols.
[Thread debugging using libthread_db enabled]
[New Thread -1208273232 (LWP 11512)]
[New Thread -1211958368 (LWP 11513)]
[KCrash handler]
#6  0x02791343 in QFontMetrics::width ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#7  0x028dc5f7 in QListViewItem::width ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#8  0x028d8cf8 in QListView::widthChanged ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#9  0x028d8e7b in QListViewItem::widthChanged ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#10 0x028d9547 in QListViewItem::setup ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#11 0x028ce816 in QListViewItem::totalHeight ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#12 0x028ce7f3 in QListViewItem::totalHeight ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#13 0x028cf728 in QListView::updateGeometries ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#14 0x028cf9cb in QListView::updateContents ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#15 0x02b7c3bf in QListView::qt_invoke ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#16 0x0313c813 in KListView::qt_invoke () from /usr/lib/libkdeui.so.4
#17 0x027de2aa in QObject::activate_signal ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#18 0x027dec3d in QObject::activate_signal ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#19 0x02b698f9 in QTimer::timeout () from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#20 0x028056bf in QTimer::event () from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#21 0x02775a1b in QApplication::internalNotify ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#22 0x02777059 in QApplication::notify ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#23 0x00ac4ac3 in KApplication::notify () from /usr/lib/libkdecore.so.4
#24 0x0276993c in QEventLoop::activateTimers ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#25 0x0271e10f in QEventLoop::processEvents ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#26 0x0278f135 in QEventLoop::enterLoop ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#27 0x0278efde in QEventLoop::exec () from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#28 0x0277565f in QApplication::exec () from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#29 0x08054f6e in main (argc=159944568, argv=0xbf9d4e68) at main.cpp:818
Comment 2 George Staikos 2007-03-16 00:32:09 UTC
SVN commit 642969 by staikos:

Keep track of deleted nodes.  Unfortunately this makes the tree "heavy" as it
requires all ndoes to be QObjects but there is no other way that is this clean
and non-intrusive.  Reviewed by Eli.

BUG: 143027


 M  +1 -1      libkst/kstobjectcollection.h  
 M  +1 -1      libkstapp/kstscalarlistview.h  
 M  +1 -1      libkstapp/kststringlistview.h  


--- trunk/extragear/graphics/kst/src/libkst/kstobjectcollection.h #642968:642969
@@ -44,7 +44,7 @@
 
 /** KstObject Naming Tree */
 template <class T>
-class KstObjectTreeNode {
+class KstObjectTreeNode : QObject {
   public:
     KstObjectTreeNode(const QString& tag = QString::null);
     ~KstObjectTreeNode();
--- trunk/extragear/graphics/kst/src/libkstapp/kstscalarlistview.h #642968:642969
@@ -49,7 +49,7 @@
   private:
     void commonConstructor();
 
-    KstObjectTreeNode<KstScalar> *_node;
+    QGuardedPtr<KstObjectTreeNode<KstScalar> > _node;
 };
 
 #endif
--- trunk/extragear/graphics/kst/src/libkstapp/kststringlistview.h #642968:642969
@@ -46,7 +46,7 @@
     KstObjectTreeNode<KstString> *node() const { return _node; }
 
   private:
-    KstObjectTreeNode<KstString> *_node;
+    QGuardedPtr<KstObjectTreeNode<KstString> > _node;
 };
 
 #endif