Severe Time Bug Year 1000 to Year 999

Asked by JimWayda on 2009-12-08

With the Stellarium Time Window set your location to your city and set the time to 0900AM. Turn off Atmosphere using the "A" Command. Select the SUN and center the Sum using the SpaceBar.

Bring up the Time Window and set the year to 1000. Leave the time set to 0900AM. Using the up-arrow in the date window, advance the year to 1001 and then 1002, 1003. Notice the SMALL CHANGE in the altitude of the Sun in the sky.

Now use the down-arrow in the date window and reduce the year to 1002, 1001, 1000 and then finally 999.

Notice that the position of Sun in the sky (altitude) is VERY WRONG.

Please help. I need to use this program for a demonstration within the next week and need a fix to this bug. The program does not work correctly for years less than year 1000.

Thanks,

-jim

Question information

Language:
English Edit question
Status:
Solved
For:
Stellarium Edit question
Assignee:
No assignee Edit question
Last query:
2009-12-10
Last reply:
2011-01-13
JimWayda (jimwayda) said : #1

Sorry I forgot to say I am using version 0.10.2.

Bogdan Marinov (daggerstab) said : #2

This bug has been reported already, but as far as I know, nobody is working on it. And, as far as I know, there is no known work-around.

I can have a look into it if necessary. But even if someone fixes it in the development version, you will have to build Stellarium from source, or have someone build it for you. Which operating system do you use?

JimWayda (jimwayda) said : #3

I plan on using Stellarium for a demonstration of December 21st and therefore I need to have this bug fixed. I am an embedded firmware developer and have seen bugs like this and really wonder if it is something as simple as a signed integer problem but since I don't know what internal time format (epoc or other format). I am using Windows XP SP3. If the problem is fixed, I will need someone to build it for me since I don't have the tools available. Thanks. - jim

Bogdan Marinov (daggerstab) said : #4

OK. If the bug is fixed, I can make a test build for Windows XP.

JimWayda (jimwayda) said : #5

Bogdan,

Thank you for volunteering to make a test build if the problem is fixed. I really appreciate your help. -jim

Bogdan Marinov (daggerstab) said : #6

I identified the reason for this behaviour yesterday and I have proposed a fix. I'm waiting for confirmation from the more senior developers that my fix doesn't break anything else.

Meanwhile, a few questions:
Do you need constellation boundaries for your presentation? The graphics engine is being rewritten at the moment and turning on constellation boundaries slows down Stellarium significantly.

I'm asking because if you don't need them, I'll just build the most recent revision. If you need them, I'll use the code of 0.10.2 and only fix the 999/1000 bug.

JimWayda (jimwayda) said : #7

Bogdan,

I will not be using the constellation boundaries for the demonstration that I am giving, however it is a feature that I normally use for other reasons. I will have several days to test the code that you provide so maybe the 0.10.2 code would be better with just the time fix. Since I am a software developer, I am very interested in the reason for the bug and would very much appreciate if you could provide me with that information. Thanks you very much for attacking this bug so quickly. -jim

Bogdan Marinov (daggerstab) said : #8

The bug was caused by an incorrect conversion in a function that provided the difference between local time and GMT. Under certain conditions, it fails, returning a very large value (several years).

The relevant code is here, lines 640+:
http://stellarium.svn.sourceforge.net/viewvc/stellarium/trunk/stellarium/src/core/StelUtils.cpp?revision=5286&view=markup

A more detailed description can be seen in the stelarium-devel mailing list archive:
https://lists.launchpad.net/stellarium-devel/msg00037.html
I'm still waiting for Fabien's reply. It is possible that the... non-optimal code is a bug workaround of some sort.

Anyway, I'm going to build a 0.10.2 version with the bug fixed. How should I send it to you?

JimWayda (jimwayda) said : #9

I can receive up to 20MB in email or if you post it to an FTP site, I can download it from there. Will it have a version so that I can identify it from a normal 0.10.2 version? Thanks. -jim

JimWayda (jimwayda) said : #10

Bogdan,

I have setup an FTP Site to receive the installation package. The information follows:

ftp.wayda.com

User: <email address hidden>
Password: stellarium

You can deposit the package there.

Thanks very much. -jim

--- On Wed, 12/9/09, JimWayda <email address hidden> wrote:

From: JimWayda <email address hidden>
Subject: Re: [Question #93283]: Severe Time Bug Year 1000 to Year 999
To: <email address hidden>
Date: Wednesday, December 9, 2009, 9:35 AM

Your question #93283 on Stellarium changed:
https://answers.launchpad.net/stellarium/+question/93283

JimWayda posted a new comment:
I can receive up to 20MB in email or if you post it to an FTP site, I
can download it from there. Will it have a version so that I can
identify it from a normal 0.10.2 version? Thanks. -jim

--
You received this question notification because you are a direct
subscriber of the question.

JimWayda (jimwayda) said : #11

It appears that my posting on the website had the ftp user name gratuitously stripped. Here is the information so it won't be stripped:

ftp.wayda.com

User: stellariumATwayda.com
Password: stellarium

Note: Replace "AT" with the "@" (ampersand) sign. -jim

--- On Wed, 12/9/09, JimWayda <email address hidden> wrote:

From: JimWayda <email address hidden>
Subject: Re: [Question #93283]: Severe Time Bug Year 1000 to Year 999
To: <email address hidden>
Date: Wednesday, December 9, 2009, 10:51 AM

Your question #93283 on Stellarium changed:
https://answers.launchpad.net/stellarium/+question/93283

    Status: Answered => Open

You are still having a problem:
Bogdan,

I have setup an FTP Site to receive the installation package. The
information follows:

ftp.wayda.com

User: <email address hidden>
Password: stellarium

You can deposit the package there.

Thanks very much. -jim

--- On Wed, 12/9/09, JimWayda <email address hidden>
wrote:

From: JimWayda <email address hidden>
Subject: Re: [Question #93283]: Severe Time Bug Year 1000 to Year 999
To: <email address hidden>
Date: Wednesday, December 9, 2009, 9:35 AM

Your question #93283 on Stellarium changed:
https://answers.launchpad.net/stellarium/+question/93283

JimWayda posted a new comment:
I can receive up to 20MB in email or if you post it to an FTP site, I
can download it from there. Will it have a version so that I can
identify it from a normal 0.10.2 version? Thanks. -jim

--
You received this question notification because you are a direct
subscriber of the question.

You received this question notification because you are a direct
subscriber of the question.

Bogdan Marinov (daggerstab) said : #12

Thank you. I'm still working on the build. Version 0.10.2 uses some dependencies that were dropped later. It should be ready in an hour.

The build will have the SVN revision on the splash screen - 4346.

Bogdan Marinov (daggerstab) said : #13

The build is ready, I'm trying to upload it.

Bogdan Marinov (daggerstab) said : #14

I have uploaded the setup file. Please verify that the transfer was successful.

Before installing it, please make sure that the previous version of Stellarium has been uninstalled successfully.

JimWayda (jimwayda) said : #15

Bogdan,

I uploaded and installed after uninstalling the previous version. It seemed to be find and then I encountered a severe problem. My location was initially set to Laguna Niguel, CA and everything worked fine. Then I exited Stellarium and set the Windows System Clock to the Badhdad Iraq tiimezone GMT+3. I then restarted Stellarium and set my location to Baghdad Iraq. This seemed to work. I did some examination of objects in the sky and verified that you fixed the 1000->999 year problem. Next I exited Stellarium and set the Windows System Clock back to my Pacific Timezone of GMT-8. Then I restarted Stellarium and set my location back to Laguna Niguel, CA. I then found that the time being displayed by Stellarium was incorrect. It is displaying the time as 21:35 when the real local time is 13:35. Note that 21:35 would be correct if you are displaying the time in GMT. It is really quite strange. Note that I have Stellarium configured to use the system clock
 time upon startup. Any idea what could have caused this problem? I can't seem to get it to display the correct local time. Thanks. -jim

________________________________
From: Bogdan Marinov <email address hidden>
To: <email address hidden>
Sent: Wed, December 9, 2009 12:55:01 PM
Subject: Re: [Question #93283]: Severe Time Bug Year 1000 to Year 999

Your question #93283 on Stellarium changed:
https://answers.launchpad.net/stellarium/+question/93283

    Status: Open => Answered

Bogdan Marinov proposed the following answer:
I have uploaded the setup file. Please verify that the transfer was
successful.

Before installing it, please make sure that the previous version of
Stellarium has been uninstalled successfully.

--
If this answers your question, please go to the following page to let us
know that it is solved:
https://answers.launchpad.net/stellarium/+question/93283/+confirm?answer_id=13

If you still need help, you can reply to this email or go to the
following page to enter your feedback:
https://answers.launchpad.net/stellarium/+question/93283

You received this question notification because you are a direct
subscriber of the question.

JimWayda (jimwayda) said : #16

Hi Bogdan,

It seems that the special version that you made for me always displays the time in GMT. I am wondering if something has changed in the Stellarium "ini" file that is causing the time to always be displayed in GMT. If this cannot be changed easily, I can certainly live with this restriction of displaying the time in GMT because you fixed the year 1000->999 problem. It now works fine. Thank you again for all of your effort making this version. I was also wondering if you know of a release date for 0.10.3 and also if it is possible for me to download and test beta versions. Thanks. -jim

________________________________
From: JimWayda <email address hidden>
To: <email address hidden>
Sent: Wed, December 9, 2009 1:42:11 PM
Subject: Re: [Question #93283]: Severe Time Bug Year 1000 to Year 999

Your question #93283 on Stellarium changed:
https://answers.launchpad.net/stellarium/+question/93283

    Status: Answered => Open

You are still having a problem:
Bogdan,

I uploaded and installed after uninstalling the previous version. It seemed to be find and then I encountered a severe problem. My location was initially set to Laguna Niguel, CA and everything worked fine. Then I exited Stellarium and set the Windows System Clock to the Badhdad Iraq tiimezone GMT+3. I then restarted Stellarium and set my location to Baghdad Iraq. This seemed to work. I did some examination of objects in the sky and verified that you fixed the 1000->999 year problem. Next I exited Stellarium and set the Windows System Clock back to my Pacific Timezone of GMT-8. Then I restarted Stellarium and set my location back to Laguna Niguel, CA. I then found that the time being displayed by Stellarium was incorrect. It is displaying the time as 21:35 when the real local time is 13:35. Note that 21:35 would be correct if you are displaying the time in GMT. It is really quite strange. Note that I have Stellarium configured to use the system clock
time upon startup. Any idea what could have caused this problem? I can't seem to get it to display the correct local time. Thanks. -jim

________________________________
From: Bogdan Marinov <email address hidden>
To: <email address hidden>
Sent: Wed, December 9, 2009 12:55:01 PM
Subject: Re: [Question #93283]: Severe Time Bug Year 1000 to Year 999

Your question #93283 on Stellarium changed:
https://answers.launchpad.net/stellarium/+question/93283

    Status: Open => Answered

Bogdan Marinov proposed the following answer:
I have uploaded the setup file. Please verify that the transfer was
successful.

Before installing it, please make sure that the previous version of
Stellarium has been uninstalled successfully.

--
If this answers your question, please go to the following page to let us
know that it is solved:
https://answers.launchpad.net/stellarium/+question/93283/+confirm?answer_id=13

If you still need help, you can reply to this email or go to the
following page to enter your feedback:
https://answers.launchpad.net/stellarium/+question/93283

You received this question notification because you are a direct
subscriber of the question.

You received this question notification because you are a direct
subscriber of the question.

Bogdan Marinov (daggerstab) said : #17

The problem is in my fix. It turns out that there is a reason for the string conversion.

I have fixed the bug (for good, I hope) and I have uploaded a new setup file to the FTP server.

Again, before installing, please make sure that the previous version of Stellarium has been uninstalled successfully - this one has the same version number, only the name of the setup file is different.

JimWayda (jimwayda) said : #18

Hi Bogdan,

Thanks for the update, however a manifestation of the original problem has returned. When you transition from year 1 to year 0 the original problem occurs. For the presentation that I will be giving, I need to use "negative number" years. -jim

________________________________
From: Bogdan Marinov <email address hidden>
To: <email address hidden>
Sent: Thu, December 10, 2009 12:46:11 AM
Subject: Re: [Question #93283]: Severe Time Bug Year 1000 to Year 999

Your question #93283 on Stellarium changed:
https://answers.launchpad.net/stellarium/+question/93283

    Status: Open => Answered

Bogdan Marinov proposed the following answer:
The problem is in my fix. It turns out that there is a reason for the
string conversion.

I have fixed the bug (for good, I hope) and I have uploaded a new setup
file to the FTP server.

Again, before installing, please make sure that the previous version of
Stellarium has been uninstalled successfully - this one has the same
version number, only the name of the setup file is different.

--
If this answers your question, please go to the following page to let us
know that it is solved:
https://answers.launchpad.net/stellarium/+question/93283/+confirm?answer_id=16

If you still need help, you can reply to this email or go to the
following page to enter your feedback:
https://answers.launchpad.net/stellarium/+question/93283

You received this question notification because you are a direct
subscriber of the question.

JimWayda (jimwayda) said : #19

Bogdan,
The year 1000->999 problem is fixed, however the problem has now moved from year 1->0 in your latest fix to resolve the GMT time display issue. -jim

________________________________
From: Bogdan Marinov <email address hidden>
To: <email address hidden>
Sent: Thu, December 10, 2009 9:44:41 AM
Subject: [Question #93283]: Status of bug #490423 changed to 'Fix Committed' in Stellarium

Bug #490423 status changed in Stellarium:

    Confirmed => Fix Committed

https://bugs.launchpad.net/stellarium/+bug/490423
"strange jump between: 999 dec 31 and 1000 jan 1"

This bug is linked to #93283.
Severe Time Bug Year 1000 to Year 999
https://answers.launchpad.net/stellarium/+question/93283

--
You received this question notification because you are a direct
subscriber of the question.

Bogdan Marinov (daggerstab) said : #20

I know. I have fixed the issue and I am uploading a new version to the FTP server now (15 minutes left, slow connection). The "fix committed" refers to that fix:
http://stellarium.svn.sourceforge.net/viewvc/stellarium?view=rev&revision=5442

It's faster to commit a kilobyte to the repository at SourceForge than to upload 50 megabytes to that FTP server. :)

JimWayda (jimwayda) said : #21

Thanks Bogdan for the new fix. That ftp server is provided by yahoo (LOL) :-)
------Original Message------
From: Bogdan Marinov
Sender: <email address hidden>
To: Jim Wayda
Subject: Re: [Question #93283]: Status of bug #490423 changed to 'FixCommitted' in Stellarium
Sent: Dec 10, 2009 9:57 AM

Your question #93283 on Stellarium changed:
https://answers.launchpad.net/stellarium/+question/93283

    Status: Open => Answered

Bogdan Marinov proposed the following answer:
I know. I have fixed the issue and I am uploading a new version to the FTP server now (15 minutes left, slow connection). The "fix committed" refers to that fix:
http://stellarium.svn.sourceforge.net/viewvc/stellarium?view=rev&revision=5442

It's faster to commit a kilobyte to the repository at SourceForge than
to upload 50 megabytes to that FTP server. :)

--
If this answers your question, please go to the following page to let us
know that it is solved:
https://answers.launchpad.net/stellarium/+question/93283/+confirm?answer_id=19

If you still need help, you can reply to this email or go to the
following page to enter your feedback:
https://answers.launchpad.net/stellarium/+question/93283

You received this question notification because you are a direct
subscriber of the question.

-jim
Sent from my BlackBerry®

Bogdan Marinov (daggerstab) said : #22

The new setup file has been uploaded successfully.

JimWayda (jimwayda) said : #23

Hi Bogdan, this version seems to be working fine with all dates. I will do more extensive testing later this evening. -jim

________________________________
From: Bogdan Marinov <email address hidden>
To: <email address hidden>
Sent: Thu, December 10, 2009 10:14:45 AM
Subject: Re: [Question #93283]: Status of bug #490423 changed to 'FixCommitted' in Stellarium

Your question #93283 on Stellarium changed:
https://answers.launchpad.net/stellarium/+question/93283

    Status: Open => Answered

Bogdan Marinov proposed the following answer:
The new setup file has been uploaded successfully.

--
If this answers your question, please go to the following page to let us
know that it is solved:
https://answers.launchpad.net/stellarium/+question/93283/+confirm?answer_id=21

If you still need help, you can reply to this email or go to the
following page to enter your feedback:
https://answers.launchpad.net/stellarium/+question/93283

You received this question notification because you are a direct
subscriber of the question.

JimWayda (jimwayda) said : #24

Bogdan,

I have tested your fix and don't find any problems with the rendering of the sky for any dates including negative date values. The only very minor issue that I found is that in the Date and Time Tool. You cannot change the "day field" by highlighting the "day field" and typing in the numeric day value. It does not allow you to do this. Note that you can highlight and type into any of the other fields such as the year or month fields and also all of the time fields. The only problem is the "day field". This problem can be worked-around by using the little arrow keys that are located over the "day field". You change the value of the day by clicking on the arrow keys above or below the "day field" with the mouse. Therefore the problem is only a very minor annoyance and is not even an issue for me. I just wanted you to be aware of the problem so that it can be fixed in the next official release of the code. I am not even sure if this problem exists in the 0.10.2 standard code release. Thank you again for your work in fixing this problem. -jim

treaves (treaves) said : #25

As this was taken care of...