Bug 96039 - d2asc crashes on dirfiles
Summary: d2asc crashes on dirfiles
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Applications
Component: general (show other bugs)
Version: 1.x
Platform: Slackware Linux
: NOR crash
Target Milestone: ---
Assignee: kst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-30 19:37 UTC by Matthew Truch
Modified: 2005-01-05 06:35 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 Matthew Truch 2004-12-30 19:37:09 UTC
Version:           1.1.0_devel (using KDE KDE 3.3.2)
Installed from:    Slackware Packages
OS:                Linux

d2asc segfaults any time you try and extract any dirfile data.  It segfaults before any data is extracted.   

This is true with d2asc from kst 1.0.0 as well as recent cvs.
Comment 1 George Staikos 2005-01-05 06:31:22 UTC
CVS commit by staikos: 

Fix most of the dirfile crash problems, but not all of it.  It crashes on exit
now.

CCBUG: 96039


  M +32 -0     d2asc.cpp   1.18


--- kdeextragear-2/kst/kst/d2asc.cpp  #1.17:1.18
@@ -1,7 +1,28 @@
+/***************************************************************************
+                                d2asc.cpp
+                             -------------------
+    begin                : Tue Aug 22 13:46:13 CST 2000
+    copyright            : (C) 2000 by Barth Netterfield
+    email                :
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
 #include <stdlib.h> // atoi
+#include <kconfig.h>
 #include <kinstance.h>
 
+// hack to make main() a friend of kstdatasource
+#define protected public
 #include "kstrvector.h"
 #include "kstdatacollection.h"
+#undef protected
 
 void Usage() {
@@ -12,9 +33,20 @@ void Usage() {
 }
 
+
+static void exitHelper() {
+  KST::vectorList.clear();
+  KST::scalarList.clear();
+  KST::dataObjectList.clear();
+}
+
 int main(int argc, char *argv[]) {
+  atexit(exitHelper);
   KInstance inst("d2asc");
   KstDataSourcePtr file;
   int i;
 
+  KConfig *kConfigObject = new KConfig("kstdatarc", false, false);
+  KstDataSource::setupOnStartup(kConfigObject);
+
   char field_list[40][120], filename[180];
   bool do_hex[40];


Comment 2 George Staikos 2005-01-05 06:35:34 UTC
CVS commit by staikos: 

the rest of the crashes in d2asc
BUG: 96039


  M +0 -1      d2asc.cpp   1.19


--- kdeextragear-2/kst/kst/d2asc.cpp  #1.18:1.19
@@ -103,5 +103,4 @@ int main(int argc, char *argv[]) {
   /** make vectors and fill the list **/
   QPtrList<KstRVector> vlist;
-  vlist.setAutoDelete(true);
 
   for (i=0; i<n_field; i++) {