<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>113611</bug_id>
          
          <creation_ts>2005-09-30 10:45:38 +0000</creation_ts>
          <short_desc>SIGSEGV after telescope not found</short_desc>
          <delta_ts>2005-10-01 04:23:45 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>kstars</product>
          <component>general</component>
          <version>1.1</version>
          <rep_platform>Debian testing</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>crash</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Oliver Grimm">logistikka</reporter>
          <assigned_to>kstars</assigned_to>
          
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>377506</commentid>
    <comment_count>0</comment_count>
    <who name="Oliver Grimm">logistikka</who>
    <bug_when>2005-09-30 10:45:38 +0000</bug_when>
    <thetext>Version:           1.1 (using KDE KDE 3.4.1)
Installed from:    Debian testing/unstable Packages
OS:                Linux

To reproduce this crash do

- start KStars
- right click an arbitrary star
- choose &quot;add to watch list&quot; from RMB menu
- choose extra -&gt; &quot;watch list&quot; from the main menu
- left click the new entry
- click &quot;application area&quot; (2nd button)
- get a message &quot;no active telescope found&quot;
- click OK
- click at the &quot;remove&quot; button
- close the window by clicking the &quot;close&quot; button at the upper right corner of the window

You&apos;ll get a SIGSEGV.
Maybe this one is related to bug 105214.

KCrashHandler log:

`system-supplied DSO at 0xffffe000&apos; has disappeared; keeping its symbols.
(no debugging symbols found)
...
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
[New Thread -1231677760 (LWP 7411)]
...
#3  0x082324d2 in KPlotWidget::setDefaultPadding ()
#4  0xb79e19c9 in KDialogBase::qt_invoke () from /usr/lib/libkdeui.so.4
#5  0x08232b90 in KPlotWidget::setDefaultPadding ()
#6  0xb709571c in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#7  0xb7095544 in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#8  0xb73db82e in QButton::clicked () from /usr/lib/libqt-mt.so.3
#9  0xb71282cd in QButton::animateTimeout () from /usr/lib/libqt-mt.so.3
#10 0xb73db948 in QButton::qt_invoke () from /usr/lib/libqt-mt.so.3
#11 0xb73ead54 in QPushButton::qt_invoke () from /usr/lib/libqt-mt.so.3
#12 0xb7a50003 in KPushButton::qt_invoke () from /usr/lib/libkdeui.so.4
#13 0xb79da44d in KDialogBaseButton::qt_invoke () from /usr/lib/libkdeui.so.4
#14 0xb709571c in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#15 0xb73d462a in QSignal::signal () from /usr/lib/libqt-mt.so.3
#16 0xb70af91d in QSignal::activate () from /usr/lib/libqt-mt.so.3
#17 0xb70b7253 in QSingleShotTimer::event () from /usr/lib/libqt-mt.so.3
#18 0xb7038e1f in QApplication::internalNotify () from /usr/lib/libqt-mt.so.3
#19 0xb703841e in QApplication::notify () from /usr/lib/libqt-mt.so.3
#20 0xb7674ac5 in KApplication::notify () from /usr/lib/libkdecore.so.4
#21 0xb7028645 in QEventLoop::activateTimers () from /usr/lib/libqt-mt.so.3
#22 0xb6fe1cfb in QEventLoop::processEvents () from /usr/lib/libqt-mt.so.3
#23 0xb704b1d8 in QEventLoop::enterLoop () from /usr/lib/libqt-mt.so.3
#24 0xb704b088 in QEventLoop::exec () from /usr/lib/libqt-mt.so.3
#25 0xb7039071 in QApplication::exec () from /usr/lib/libqt-mt.so.3
#26 0x081150ad in KDoubleNumInput::metaObject ()
#27 0xb6999ec0 in __libc_start_main () from /lib/tls/libc.so.6
#28 0x0806cd61 in ?? ()</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>377695</commentid>
    <comment_count>1</comment_count>
    <who name="Jasem Mutlaq">mutlaqja</who>
    <bug_when>2005-09-30 14:50:19 +0000</bug_when>
    <thetext>I can&apos;t reproduce this crash.

What&apos;s your hardware spec?
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>377702</commentid>
    <comment_count>2</comment_count>
    <who name="Oliver Grimm">logistikka</who>
    <bug_when>2005-09-30 15:22:15 +0000</bug_when>
    <thetext>There was NO telescope attached to the system nor any other astro device. Hardware specs here are i686, 2.6 GHz, 512 MB RAM.

What else do you need to know?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>377718</commentid>
    <comment_count>3</comment_count>
    <who name="">kstars</who>
    <bug_when>2005-09-30 16:46:05 +0000</bug_when>
    <thetext>Hi,

Thanks for the report.  I am also unable to reproduce the crash following 
these steps.  It&apos;s possible that the bug has been fixed since 3.4.1.  You 
could try KDE-3.5-beta1 or if you don&apos;t want to run the whole desktop from 
beta1, you can get a recent KStars SVN snapshot here:
http://www.30doradus.org/kstars/

Let us know if you try it.

Jason

On Friday 30 September 2005 01:45, Oliver Grimm wrote:
[bugs.kde.org quoted mail]
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>377724</commentid>
    <comment_count>4</comment_count>
    <who name="">kstars</who>
    <bug_when>2005-09-30 16:57:07 +0000</bug_when>
    <thetext>More information:  I still have KStars from KDE-3.4.1 on disk, so I tried that, and I still can&apos;t reproduce the crash following your steps.

However, I noticed your backtrace contains KPlotWidget, which should not be called from the Observing List (or &quot;watch list&quot; in your localization?).  The only way you could get such a backtrace from the Observing List is if you opened the &quot;Altitude vs Time&quot; tool.

So, I tried following your steps, except I clicked on &quot;Alt vs. Time&quot; instead of &quot;Remove&quot;.  This produces a crash under 3.4.1, but not under the 3.5 SVN code.  I&apos;ll look into patching it, because I&apos;ve heard there&apos;s actually going to be a 3.4.3 release.

Thansk again.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>377859</commentid>
    <comment_count>5</comment_count>
    <who name="">kstars</who>
    <bug_when>2005-10-01 04:23:43 +0000</bug_when>
    <thetext>SVN commit 465866 by harris:

Fixing BR #113611 (SIGSEGV in Observing List tool).

Added a &quot;SkyObject *oCurrent&quot; member to keep track of the 
currently-selected object.  THis had been fixed in the 3.5 branch 
already, but I didn&apos;t backport because I didn&apos;t realize there would be a 
3.4.3 release.

Also updated version number in the 3.4 branch to to 1.1.3 for the 
kde-3.4.3 release.

BUG: 113611



 M  +1 -1      main.cpp  
 M  +21 -17    tools/observinglist.cpp  
 M  +1 -1      tools/observinglist.h  


--- branches/KDE/3.4/kdeedu/kstars/kstars/main.cpp #465865:465866
@@ -29,7 +29,7 @@
 #include &quot;ksnumbers.h&quot;
 #include &quot;Options.h&quot;
 
-#define KSTARS_VERSION &quot;1.1.1&quot;
+#define KSTARS_VERSION &quot;1.1.3&quot;
 
 static const char description[] =
 	I18N_NOOP(&quot;Desktop Planetarium&quot;);
--- branches/KDE/3.4/kdeedu/kstars/kstars/tools/observinglist.cpp #465865:465866
@@ -43,7 +43,7 @@
 
 ObservingList::ObservingList( KStars *_ks, QWidget* parent )
 		: KDialogBase( KDialogBase::Plain, i18n( &quot;Observing List&quot; ), 
-				Close, Close, parent, &quot;observinglist&quot;, false ), ks( _ks ), LogObject(0), noNameStars(0)
+				Close, Close, parent, &quot;observinglist&quot;, false ), ks( _ks ), LogObject(0), oCurrent(0), noNameStars(0)
 {
 	QFrame *page = plainPage();
 //	setMainWidget( page );
@@ -160,12 +160,10 @@
 }
 
 void ObservingList::slotNewSelection() {
-	//DEBUG
-	kdDebug() &lt;&lt; &quot;selected item changed&quot; &lt;&lt; endl;
-
 	//Construct list of selected objects
 	SelectedObjects.clear();
 	QListViewItemIterator it( ui-&gt;table, QListViewItemIterator::Selected ); //loop over selected items
+
 	while ( it.current() ) {
 		for ( SkyObject *o = obsList.first(); o; o = obsList.next() ) {
 			if ( it.current()-&gt;text(0) == i18n(&quot;star&quot;) ) {
@@ -185,7 +183,6 @@
 	//Enable widgets when one object selected
 	if ( SelectedObjects.count() == 1 ) {
 		QString newName( SelectedObjects.first()-&gt;translatedName() );
-		QString oldName( obsList.current()-&gt;translatedName() );
 		
 		//Enable buttons
 		ui-&gt;CenterButton-&gt;setEnabled( true );
@@ -195,7 +192,7 @@
 		ui-&gt;RemoveButton-&gt;setEnabled( true );
 		
 		//Find the selected object in the obsList,
-		//then break the loop.  Now obsList.current()
+		//then break the loop.  Now oCurrent
 		//points to the new selected object (until now it was the previous object)
 		bool found( false );
 		for ( SkyObject* o = obsList.first(); o; o = obsList.next() ) {
@@ -231,6 +228,11 @@
 			ui-&gt;NotesEdit-&gt;setEnabled( false );
 		}
 
+		//This shouldn&apos;t be necessary.  For some reason, obsList.current() 
+		//is valid here, but in subsequent functions (such as slotCenterObject) 
+		//called *right after* this one, obsList.current()==NULL.  No idea why.
+		oCurrent = obsList.current();
+
 	} else if ( SelectedObjects.count() == 0 ) {
 		//Disable buttons
 		ui-&gt;CenterButton-&gt;setEnabled( false );
@@ -240,7 +242,8 @@
 		ui-&gt;RemoveButton-&gt;setEnabled( false );
 		ui-&gt;NotesLabel-&gt;setEnabled( false );
 		ui-&gt;NotesEdit-&gt;setEnabled( false );
-		
+		oCurrent = 0;
+
 		//Clear the user log text box.
 		saveCurrentUserLog();
 	} else { //more than one object selected.
@@ -251,16 +254,17 @@
 		ui-&gt;RemoveButton-&gt;setEnabled( true );
 		ui-&gt;NotesLabel-&gt;setEnabled( false );
 		ui-&gt;NotesEdit-&gt;setEnabled( false );
-		
+		oCurrent = 0;
+
 		//Clear the user log text box.
 		saveCurrentUserLog();
 	}
 }
 
 void ObservingList::slotCenterObject() {
-	if ( obsList.current() ) {
-		ks-&gt;map()-&gt;setClickedObject( obsList.current() );
-		ks-&gt;map()-&gt;setClickedPoint( obsList.current() );
+	if ( oCurrent ) {
+		ks-&gt;map()-&gt;setClickedObject( oCurrent );
+		ks-&gt;map()-&gt;setClickedPoint( oCurrent );
 		ks-&gt;map()-&gt;slotCenter();
 	}
 }
@@ -274,7 +278,7 @@
   bool useJ2000( false);
   SkyPoint sp;
   
-  if (obsList.current() == NULL)
+  if (oCurrent == NULL)
     return;
   
   // Find the first device with EQUATORIAL_EOD_COORD or EQUATORIAL_COORD and with SLEW element
@@ -315,7 +319,7 @@
        
        onSet-&gt;activateSwitch(&quot;SLEW&quot;);
        
-       sp.set (obsList.current()-&gt;ra(), obsList.current()-&gt;dec());
+       sp.set (oCurrent-&gt;ra(), oCurrent-&gt;dec());
        
        if (useJ2000)
 	 sp.apparentCoord(ks-&gt;data()-&gt;ut().djd(), (long double) J2000);
@@ -338,8 +342,8 @@
 //FIXME: This will open multiple Detail windows for each object;
 //Should have one window whose target object changes with selection
 void ObservingList::slotDetails() {
-	if ( obsList.current() ) {
-		DetailDialog dd( obsList.current(), ks-&gt;data()-&gt;lt(), ks-&gt;geo(), ks );
+	if ( oCurrent ) {
+		DetailDialog dd( oCurrent, ks-&gt;data()-&gt;lt(), ks-&gt;geo(), ks );
 		dd.exec();
 	}
 }
@@ -359,8 +363,8 @@
 void ObservingList::slotClose() {
 	//Save the current User log text
 	if ( ! ui-&gt;NotesEdit-&gt;text().isEmpty() &amp;&amp; ui-&gt;NotesEdit-&gt;text() 
-					!= i18n(&quot;Record here observation logs and/or data on %1.&quot;).arg( obsList.current()-&gt;name()) ) {
-		obsList.current()-&gt;saveUserLog( ui-&gt;NotesEdit-&gt;text() );
+					!= i18n(&quot;Record here observation logs and/or data on %1.&quot;).arg( oCurrent-&gt;name()) ) {
+		oCurrent-&gt;saveUserLog( ui-&gt;NotesEdit-&gt;text() );
 	}
 	
 	hide();
--- branches/KDE/3.4/kdeedu/kstars/kstars/tools/observinglist.h #465865:465866
@@ -125,7 +125,7 @@
 	ObservingListUI *ui;
 	QPtrList&lt;SkyObject&gt; obsList;
 	QPtrList&lt;SkyObject&gt; SelectedObjects;
-	SkyObject *LogObject;
+	SkyObject *LogObject, *oCurrent;
 	uint noNameStars;
 };
 
</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>