Skip to content

Keps download logic has a bug #17

@FastThenLeft

Description

@FastThenLeft

First, thanks for such a great app! I use it all the time. I've shown it to all my satellite friends and they now run it too!

Second, issue #14 and #15 are manifestations of the same bug which I also have and all my friends that use the app have too.

So, I started to debug it. I don't know Java, but I can do some debugging. Here's what I found. I'm using Ubuntu, so I'll show some linux commands.

It's an easily repeatable bug.

First, start out with a running KlaTrack. Then close the app and set the timestamp on nasabare.txt to more than 24 hours in the past:
$ touch -d "1 day ago" nasabare.txt

Now run the app and you get:
$ java -jar KlaTrack.jar
Downloading new keps ..
.. keps are current
... open output file ../home/david/KLATrack/nasabare.txt
... getting file ..
SERIOUS ERROR - Uncaught and thrown from GUI
java.lang.NullPointerException
at java.base/sun.nio.ch.FileChannelImpl.transferFrom(FileChannelImpl.java:766)
at com.g0kla.track.SatManager.fetchTLEFile(SatManager.java:188)
at com.g0kla.track.SatManager.loadTLEFile(SatManager.java:125)
at com.g0kla.track.SatManager.(SatManager.java:53)
at com.g0kla.track.gui.MainWindow.(MainWindow.java:267)
at com.g0kla.track.TrackMain$1.run(TrackMain.java:98)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

The bug occurs in SatManager.java on line 188. The result is that it sets nasabare.txt to a zero-byte file which results in a display with no satellites being tracked when you run the app again.

I believe the bug is that when:
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
is run, rbc is null because of the path through the code which causes the "SERIOUS ERROR - Uncaught and thrown from GUI" error.

I'm hoping that gives you enough pointers that you may look at it and go, "oh yeah, I see what's going on." If not, I'll continue to look at it and see if I can figure out the logic.

Thanks!

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions