Bug 85821 - crash when opening non-existant file from command line
Summary: crash when opening non-existant file from command line
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Applications
Component: general (show other bugs)
Version: 1.x
Platform: RedHat Enterprise Linux Linux
: NOR crash
Target Milestone: ---
Assignee: kst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-23 22:25 UTC by Matthew Truch
Modified: 2004-07-26 02:12 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Truch 2004-07-23 22:25:34 UTC
Version:           0.99devel (using KDE KDE 3.2.1)
Installed from:    RedHat RPMs
OS:                Linux

If you give kst a file from the command line, and the file doesn't exist, kst will crash.  

how to reproduce (from command line):  
$ kst abcdefg.txt
(assuming abcdegf.txt does not exist in the current directory).
Comment 1 George Staikos 2004-07-24 05:50:27 UTC
Cannot reproduce with CVS-HEAD.  Possibly due to latest crash fix.  Please reopen with backtrace if it's still a problem.
Comment 2 Matthew Truch 2004-07-24 23:24:46 UTC
It does not crash if you do:
kst abcdefg.txt
but does crash if you do something like:
kst -y vector_name abcdefg.txt

I cannot produce useful backtraces with my systems.  sorry.  :-(
Comment 3 George Staikos 2004-07-25 09:13:57 UTC
Still can't reproduce:

$ kst -y 1 sdkfkd.txt
kst: : KDockWidget::setHeader
kst: KDockWidgetHeader::showUndockButton(true)
kst: KDockWidgetHeader::showUndockButton(false)
kmdi: switch(mdiMode): default
kparts: DockMainWindow::createGUI for 0L
kst: Don't understand.  FrameCount=0 err=1
kst: -> Valid database? false
Error: No data in file: sdkfkd.txt
$
Comment 4 George Staikos 2004-07-26 02:12:48 UTC
CVS commit by staikos: 

- remove unused methods
- fix #85821 and #85733 - the same bug
      - it was an assertion failure, and this is the one place where
        KstApp::inst() can be null, in (app) destruction.  I'm not sure it's a
        good idea to be calling update methods from a destructor though.

CCMAIL: 85821-done@bugs.kde.org, 85733-done@bugs.kde.org


  M +0 -1      kst.cpp   1.196
  M +6 -22     kstviewwindow.cpp   1.32
  M +0 -14     kstviewwindow.h   1.17


--- kdeextragear-2/kst/kst/kst.cpp  #1.195:1.196
@@ -1243,5 +1243,4 @@ void KstApp::updateDialogs() {
     changeFileDialog->updateChangeFileDialog();
     changeNptsDialog->updateChangeNptsDialog();
-    //filterListEditor->update();
     updateDataDialogs(false);
     vectorSaveDialog->init();

--- kdeextragear-2/kst/kst/kstviewwindow.cpp  #1.31:1.32
@@ -107,8 +107,4 @@ KstViewWindow::KstViewWindow(QDomElement
 void KstViewWindow::commonConstructor() {
   config = kapp->config();
-  initStatusBar();
-  initActions();
-
-  readOptions();
 
   connect(this, SIGNAL(focusInEventOccurs( KMdiChildView*)), this, SLOT(slotActivated(KMdiChildView*)));
@@ -125,23 +121,11 @@ void KstViewWindow::updateActions() {
 
 KstViewWindow::~KstViewWindow() {
-  assert(KstApp::inst());  // email George if you get this crash
   _view->release();
-  KstApp::inst()->updateDialogsForWindow();
-}
-
-
-void KstViewWindow::initActions() {
-}
-
-
-void KstViewWindow::initStatusBar() {
-}
-
-
-void KstViewWindow::saveOptions() {
-}
-
-
-void KstViewWindow::readOptions() {
+  KstApp *app = KstApp::inst(); // Can be null on exit - but then why do
+                                // we even need to be calling this function
+                                // here?  It seems wrong to me.
+  if (app) {
+    app->updateDialogsForWindow();
+  }
 }
 

--- kdeextragear-2/kst/kst/kstviewwindow.h  #1.16:1.17
@@ -53,18 +53,4 @@ class KstViewWindow : public KMdiChildVi
 
   protected:
-    /** save options to the configuration file
-     *  Geometry, Toolbar status, Statusbar status */
-    void saveOptions();
-
-    /** read options from configuration file
-     *  Geometry, Toolbar status, Statusbar status */
-    void readOptions();
-
-    /** setup kde2 actions and build the GUI */
-    void initActions();
-
-    /** sets up the statusbar for the main window */
-    void initStatusBar();
-
     /** saves the window properties for each open window during session
      * end to the session config file, including saving the currently