stephanheinemann / worldwind

NASA Worldwind extensions for SWIM-based planning decision-making and support
2 stars 0 forks source link

Investigate Observed Exceptions #3

Open stephanheinemann opened 7 years ago

stephanheinemann commented 7 years ago

Several exceptions including NPE and CME have been observed during initial testing. Investigate and fix these problems. In general, all concurrent threads and their resources should be examined carefully to avoid any race conditions.

stephanheinemann commented 3 years ago

The following exception was triggered while creating a new planning grid environment with a previous environment and plan present in order to modify the grid layout and obtain a different trajectory.

java.util.ConcurrentModificationException at java.util.HashMap$KeySpliterator.forEachRemaining (HashMap.java:1608) at java.util.stream.AbstractPipeline.copyInto (AbstractPipeline.java:484) at java.util.stream.AbstractPipeline.wrapAndCopyInto (AbstractPipeline.java:474) at java.util.stream.ReduceOps$ReduceOp.evaluateSequential (ReduceOps.java:913) at java.util.stream.AbstractPipeline.evaluate (AbstractPipeline.java:234) at java.util.stream.ReferencePipeline.collect (ReferencePipeline.java:578) at com.cfar.swim.worldwind.ui.swim.SwimPresenter$1.run (SwimPresenter.java:108) at com.sun.javafx.application.PlatformImpl.lambda$runLater$10 (PlatformImpl.java:428) at java.security.AccessController.doPrivileged (Native Method) at com.sun.javafx.application.PlatformImpl.lambda$runLater$11 (PlatformImpl.java:427) at com.sun.glass.ui.InvokeLaterDispatcher$Future.run (InvokeLaterDispatcher.java:96) at com.sun.glass.ui.gtk.GtkApplication._runLoop (Native Method) at com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11 (GtkApplication.java:277) at java.lang.Thread.run (Thread.java:834)

stephanheinemann commented 3 years ago

The following exception was triggered while loading SWIM data:

java.util.ConcurrentModificationException at java.util.HashMap$KeySpliterator.forEachRemaining (HashMap.java:1608) at java.util.stream.AbstractPipeline.copyInto (AbstractPipeline.java:484) at java.util.stream.AbstractPipeline.wrapAndCopyInto (AbstractPipeline.java:474) at java.util.stream.ReduceOps$ReduceOp.evaluateSequential (ReduceOps.java:913) at java.util.stream.AbstractPipeline.evaluate (AbstractPipeline.java:234) at java.util.stream.ReferencePipeline.collect (ReferencePipeline.java:578) at com.cfar.swim.worldwind.ui.swim.SwimPresenter$1.run (SwimPresenter.java:108) at com.sun.javafx.application.PlatformImpl.lambda$runLater$10 (PlatformImpl.java:428) at java.security.AccessController.doPrivileged (Native Method) at com.sun.javafx.application.PlatformImpl.lambda$runLater$11 (PlatformImpl.java:427) at com.sun.glass.ui.InvokeLaterDispatcher$Future.run (InvokeLaterDispatcher.java:96) at com.sun.glass.ui.gtk.GtkApplication._runLoop (Native Method) at com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11 (GtkApplication.java:277) at java.lang.Thread.run (Thread.java:834)

stephanheinemann commented 3 years ago

java.util.ConcurrentModificationException at java.util.ArrayList$Itr.checkForComodification (ArrayList.java:1043) at java.util.ArrayList$Itr.next (ArrayList.java:997) at java.util.Collections$UnmodifiableCollection$1.next (Collections.java:1047) at gov.nasa.worldwind.layers.RenderableLayer.addRenderables (RenderableLayer.java:185) at com.cfar.swim.worldwind.ui.world.WorldPresenter$4.run (WorldPresenter.java:416) at java.awt.event.InvocationEvent.dispatch (InvocationEvent.java:313) at java.awt.EventQueue.dispatchEventImpl (EventQueue.java:770) at java.awt.EventQueue$4.run (EventQueue.java:721) at java.awt.EventQueue$4.run (EventQueue.java:715) at java.security.AccessController.doPrivileged (Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege (ProtectionDomain.java:85) at java.awt.EventQueue.dispatchEvent (EventQueue.java:740) at java.awt.EventDispatchThread.pumpOneEventForFilters (EventDispatchThread.java:203) at java.awt.EventDispatchThread.pumpEventsForFilter (EventDispatchThread.java:124) at java.awt.EventDispatchThread.pumpEventsForHierarchy (EventDispatchThread.java:113) at java.awt.EventDispatchThread.pumpEvents (EventDispatchThread.java:109) at java.awt.EventDispatchThread.pumpEvents (EventDispatchThread.java:101) at java.awt.EventDispatchThread.run (EventDispatchThread.java:90)

stephanheinemann commented 3 years ago

java.nio.BufferOverflowException at java.base/java.nio.Buffer.nextPutIndex(Buffer.java:666) at java.base/java.nio.DirectIntBufferU.put(DirectIntBufferU.java:331) at gov.nasa.worldwind.render.Path.addTessellatedPosition(Path.java:2090) at gov.nasa.worldwind.render.Path.makeSegment(Path.java:2250) at gov.nasa.worldwind.render.Path.makePositions(Path.java:2059) at gov.nasa.worldwind.render.Path.makeTessellatedPositions(Path.java:1967) at gov.nasa.worldwind.render.Path.doMakeOrderedRenderable(Path.java:1274) at gov.nasa.worldwind.render.AbstractShape.makeOrderedRenderable(AbstractShape.java:1020) at gov.nasa.worldwind.render.AbstractShape.render(AbstractShape.java:997) at com.cfar.swim.worldwind.planning.Trajectory.render(Trajectory.java:267) at gov.nasa.worldwind.layers.RenderableLayer.doRender(RenderableLayer.java:530) at gov.nasa.worldwind.layers.RenderableLayer.doRender(RenderableLayer.java:445) at gov.nasa.worldwind.layers.AbstractLayer.render(AbstractLayer.java:280) at gov.nasa.worldwind.AbstractSceneController.draw(AbstractSceneController.java:917) at gov.nasa.worldwind.StereoOptionSceneController.draw(StereoOptionSceneController.java:162) at gov.nasa.worldwind.BasicSceneController.doNormalRepaint(BasicSceneController.java:69) at gov.nasa.worldwind.BasicSceneController.doRepaint(BasicSceneController.java:52) at gov.nasa.worldwind.AbstractSceneController.repaint(AbstractSceneController.java:422) at gov.nasa.worldwind.WorldWindowGLAutoDrawable.doDisplay(WorldWindowGLAutoDrawable.java:478) at gov.nasa.worldwind.WorldWindowGLAutoDrawable.display(WorldWindowGLAutoDrawable.java:351) at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:692) at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:674) at com.jogamp.opengl.awt.GLJPanel$Updater.display(GLJPanel.java:1446) at com.jogamp.opengl.awt.GLJPanel$10.run(GLJPanel.java:1521) at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1293) at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:1147) at com.jogamp.opengl.awt.GLJPanel$OffscreenBackend.doPaintComponent(GLJPanel.java:2095) at com.jogamp.opengl.awt.GLJPanel.paintComponent(GLJPanel.java:569) at java.desktop/javax.swing.JComponent.paint(JComponent.java:1074) at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907) at java.desktop/javax.swing.JComponent.paint(JComponent.java:1083) at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907) at java.desktop/javax.swing.JComponent.paint(JComponent.java:1083) at java.desktop/sun.swing.JLightweightFrame$3.paint(JLightweightFrame.java:342) at java.desktop/javax.swing.JComponent.paintToOffscreen(JComponent.java:5255) at java.desktop/javax.swing.RepaintManager$PaintManager.paintDoubleBufferedImpl(RepaintManager.java:1643) at java.desktop/javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1618) at java.desktop/javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1556) at java.desktop/javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:262) at java.desktop/javax.swing.RepaintManager.paint(RepaintManager.java:1323) at java.desktop/javax.swing.JComponent._paintImmediately(JComponent.java:5203) at java.desktop/javax.swing.JComponent.paintImmediately(JComponent.java:5013) at java.desktop/javax.swing.JComponent.paintImmediately(JComponent.java:4994) at java.desktop/javax.swing.RepaintManager$4.run(RepaintManager.java:865) at java.desktop/javax.swing.RepaintManager$4.run(RepaintManager.java:848) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) at java.desktop/javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:848) at java.desktop/javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:823) at java.desktop/javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:772) at java.desktop/javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1890) 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)

stephanheinemann commented 3 years ago

During modification of waypoint altitudes. Edit one, the next one is highlighted, then edit the highlighted one:

at java.util.ArrayList$Itr.checkForComodification (ArrayList.java:1043) at java.util.ArrayList$Itr.next (ArrayList.java:997) at java.util.Collections$UnmodifiableCollection$1.next (Collections.java:1047) at gov.nasa.worldwind.layers.RenderableLayer.addRenderables (RenderableLayer.java:185) at com.cfar.swim.worldwind.ui.world.WorldPresenter$4.run (WorldPresenter.java:416) at java.awt.event.InvocationEvent.dispatch (InvocationEvent.java:313) at java.awt.EventQueue.dispatchEventImpl (EventQueue.java:770) at java.awt.EventQueue$4.run (EventQueue.java:721) at java.awt.EventQueue$4.run (EventQueue.java:715) at java.security.AccessController.doPrivileged (Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege (ProtectionDomain.java:85) at java.awt.EventQueue.dispatchEvent (EventQueue.java:740) at java.awt.EventDispatchThread.pumpOneEventForFilters (EventDispatchThread.java:203) at java.awt.EventDispatchThread.pumpEventsForFilter (EventDispatchThread.java:124) at java.awt.EventDispatchThread.pumpEventsForHierarchy (EventDispatchThread.java:113) at java.awt.EventDispatchThread.pumpEvents (EventDispatchThread.java:109) at java.awt.EventDispatchThread.pumpEvents (EventDispatchThread.java:101) at java.awt.EventDispatchThread.run (EventDispatchThread.java:90)

stephanheinemann commented 3 years ago

The CMEs are mainly related to passing only unmodifiable collections to the GUI thread. These are views on the original scenario collection which are being modified by the core logic. Hence, collections passed to the GUI thread need to be immutable instead: unmodifiable clones of the original collection.

stephanheinemann commented 3 years ago

This one appears to happen sometimes when trajectories are redrawn although the drawing should always happen from the EDT.

Mar. 22, 2021 4:14:26 P.M. gov.nasa.worldwind.view.BasicView pushReferenceCenter SEVERE: Point is null Mar. 22, 2021 4:14:26 P.M. gov.nasa.worldwind.AbstractSceneController draw WARNING: Exception encountered while repainting java.lang.IllegalArgumentException: Point is null at gov.nasa.worldwind.view.BasicView.pushReferenceCenter(BasicView.java:841) at gov.nasa.worldwind.render.AbstractShape.beginDrawing(AbstractShape.java:1310) at gov.nasa.worldwind.render.AbstractShape.drawOrderedRenderable(AbstractShape.java:1143) at gov.nasa.worldwind.render.AbstractShape.render(AbstractShape.java:995) at com.cfar.swim.worldwind.planning.Trajectory.render(Trajectory.java:275) at gov.nasa.worldwind.AbstractSceneController.draw(AbstractSceneController.java:949) at gov.nasa.worldwind.StereoOptionSceneController.draw(StereoOptionSceneController.java:162) at gov.nasa.worldwind.BasicSceneController.doNormalRepaint(BasicSceneController.java:69) at gov.nasa.worldwind.BasicSceneController.doRepaint(BasicSceneController.java:52) at gov.nasa.worldwind.AbstractSceneController.repaint(AbstractSceneController.java:422) at gov.nasa.worldwind.WorldWindowGLAutoDrawable.doDisplay(WorldWindowGLAutoDrawable.java:478) at gov.nasa.worldwind.WorldWindowGLAutoDrawable.display(WorldWindowGLAutoDrawable.java:351) at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:692) at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:674) at com.jogamp.opengl.awt.GLJPanel$Updater.display(GLJPanel.java:1446) at com.jogamp.opengl.awt.GLJPanel$10.run(GLJPanel.java:1521) at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1293) at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:1147) at com.jogamp.opengl.awt.GLJPanel$OffscreenBackend.doPaintComponent(GLJPanel.java:2095) at com.jogamp.opengl.awt.GLJPanel.paintComponent(GLJPanel.java:569) at java.desktop/javax.swing.JComponent.paint(JComponent.java:1074) at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907) at java.desktop/javax.swing.JComponent.paint(JComponent.java:1083) at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907) at java.desktop/javax.swing.JComponent.paint(JComponent.java:1083) at java.desktop/sun.swing.JLightweightFrame$3.paint(JLightweightFrame.java:342) at java.desktop/javax.swing.JComponent.paintToOffscreen(JComponent.java:5255) at java.desktop/javax.swing.RepaintManager$PaintManager.paintDoubleBufferedImpl(RepaintManager.java:1643) at java.desktop/javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1618) at java.desktop/javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1556) at java.desktop/javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:262) at java.desktop/javax.swing.RepaintManager.paint(RepaintManager.java:1323) at java.desktop/javax.swing.JComponent._paintImmediately(JComponent.java:5203) at java.desktop/javax.swing.JComponent.paintImmediately(JComponent.java:5013) at java.desktop/javax.swing.JComponent.paintImmediately(JComponent.java:4994) at java.desktop/javax.swing.RepaintManager$4.run(RepaintManager.java:865) at java.desktop/javax.swing.RepaintManager$4.run(RepaintManager.java:848) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) at java.desktop/javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:848) at java.desktop/javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:823) at java.desktop/javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:772) at java.desktop/javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1890) 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)

stephanheinemann commented 3 years ago

This one was observed during AD* planning. Possibly an issue during repair which introduces null waypoints into the open queue for expansion?

java.lang.IllegalArgumentException: Position is null at gov.nasa.worldwind.globes.EllipsoidalGlobe.computePointFromPosition (EllipsoidalGlobe.java:537) at com.cfar.swim.worldwind.planning.PlanningGrid.getNeighbors (PlanningGrid.java:1184) at com.cfar.swim.worldwind.ai.astar.ForwardAStarPlanner.expand (ForwardAStarPlanner.java:499) at com.cfar.swim.worldwind.ai.arastar.ARAStarPlanner.expand (ARAStarPlanner.java:382) at com.cfar.swim.worldwind.ai.adstar.ADStarPlanner.expand (ADStarPlanner.java:234) at com.cfar.swim.worldwind.ai.adstar.ADStarPlanner.compute (ADStarPlanner.java:321) at com.cfar.swim.worldwind.ai.adstar.ADStarPlanner.improve (ADStarPlanner.java:501) at com.cfar.swim.worldwind.ai.adstar.ADStarPlanner.elaborate (ADStarPlanner.java:515) at com.cfar.swim.worldwind.ai.adstar.ADStarPlanner.planPart (ADStarPlanner.java:543) at com.cfar.swim.worldwind.ai.adstar.ADStarPlanner.repair (ADStarPlanner.java:412) at com.cfar.swim.worldwind.ai.adstar.ADStarPlanner.elaborate (ADStarPlanner.java:514) at com.cfar.swim.worldwind.ai.adstar.ADStarPlanner.plan (ADStarPlanner.java:601) at com.cfar.swim.worldwind.ui.world.WorldPresenter$15.run (WorldPresenter.java:865) at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1128) at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:628) at java.lang.Thread.run (Thread.java:834)