Linux - crash? when using very slow time
Real-time 3D visualization of space
Status: Beta
Brought to you by:
cjlaurel
Running 1.5.1 on Slackware 12.1, KDE interface.
This really is something I stumbled on, not really a practical issue.
I accidently pressed the 'k' key continuously instead of some other key, and Celestia crashed on me.
This is repeatable.
The time indicator goes:
10x slow
100x slow
1000x slow
10,000x slow
100,000x slow
,000,000x slow (??)
10,000,000x slow
100,000,000x slow
,000,000,000x slow (??)
10,000,000,000x slow
100,000,000,000,000x slow
<crash>
Running through gdb with enable-debug=ll reveals nothing (application closed normally).
Reading the code I see that the time reduction should be stopped if < MinimumTimeRate (static const double MinimumTimeRate = 1.0e-15) - but it appears not to happen.
Nick
Patch to fix overflow and printf format on timerates
Logged In: YES
user_id=1257129
Originator: YES
OK, I fixed this up. It appears what was happening is an overflow when getting past 1e-11 that caused the crash. I also set the fastest/slowest time rates down a little for both values (this should be suffice, shouldn't it??).
Secondly, the top right hand timerate displayed ,000,000x and ,000,000,000x etc. because of the way floating math is done. The actual values (e.g.) was 999999.998765465 etc., so the printf format bulks. Setting ceil() here fixes this up too.
Patch attached.
Nick
File Added: speedrate.patch