[GUI] GUI crashes sometimes with NullPointerException
Summary
When using the button Run all scenarios
, the GUI simulates several scenario files properly but than a NullPointerException
is raised and the GUI does not respond anymore. See the attached stack trace for more details.
Steps to reproduce
As the exception is thrown only sometimes, I guess it is hard to reproduce the problem (maybe some race condition between GUI thread and simulation thread?).
At the moment, I am working on psychology branch, but it also occurs on master sometimes.
Relevant data
- [If you report a bug] Git branch name and commit hash: psychology/91176052
- [If you report a bug in a scenario] Use test project "Scenarios/ModelTests/TestPsychology/CognitionAndBehavior/"
Logs and outputs
NullPointerException after running eight scenarios
09:58:37,941 INFO ProjectView:169 - scenario 08-CounterFlow-OSMSequential-SBEnabled-SearchRadiusAdapted finished 09:58:37,988 INFO ScenarioRun:177 - Simulation of scenario 08-CounterFlow-OSMSequential-SBEnabled-SearchRadiusAdapted finished. 09:58:37,988 INFO ScenarioRun:124 - Initializing scenario. Start of scenario '09-OriginalExperimentSetup-OSMEventDriven'... 09:58:37,989 INFO ScenarioRun:126 - StartIt 09-OriginalExperimentSetup-OSMEventDriven 09:58:37,989 INFO ScenarioRun:105 - scenario context initialized. 09:58:37,994 INFO PotentialFieldDistancesBruteForce:47 - initialize floor field (PotentialFieldDistancesBruteForce) 09:58:38,037 INFO PotentialFieldDistancesBruteForce:82 - floor field initialization time:42[ms] 09:58:38,037 INFO Topography:351 - Set PedestrianIdCount to start value: 14 09:58:38,051 INFO EikonalSolverDefaultProvider:23 - floor field initialization time:12[ms] Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at org.vadere.gui.components.view.DefaultRenderer.transformGraphics(DefaultRenderer.java:124) at org.vadere.gui.components.view.DefaultRenderer.renderGraphics(DefaultRenderer.java:86) at org.vadere.gui.components.view.DefaultRenderer.renderImage(DefaultRenderer.java:97) at org.vadere.gui.components.view.DefaultRenderer.render(DefaultRenderer.java:68) at org.vadere.gui.onlinevisualization.view.OnlinevisualizationRenderer.render(OnlinevisualizationRenderer.java:37) at org.vadere.gui.components.view.ScaleablePanel.paintComponent(ScaleablePanel.java:108) 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.JViewport.paint(JViewport.java:737) 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.JSplitPane.paintChildren(JSplitPane.java:1024) 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/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.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)Process finished with exit code 130 (interrupted by signal 2: SIGINT)