tukkek / javelin

Party-based roguelike (open-source strategy-RPG game).
https://javelinrl.wordpress.com/
64 stars 7 forks source link

concurrent modification exception #313

Closed esranzarnath closed 1 year ago

esranzarnath commented 3 years ago

I've been seeing a lot of concurrent modification exceptions when moving the mouse over the overworld map, especially after battles, or when loading the game.

An example stack trace:

c4af3ae2 (HEAD -> 1.7, origin/1.7) Fixing #300 (super.extend() was not being called) System: Windows 7 6.1 amd64

null (class java.util.ConcurrentModificationException) java.base/java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1013) java.base/java.util.ArrayList$Itr.next(ArrayList.java:967) javelin/javelin.view.mappanel.overlay.Overlay.clear(Overlay.java:27) javelin/javelin.view.mappanel.world.WorldMouse.mouseMoved(WorldMouse.java:125) java.desktop/java.awt.Component.processMouseMotionEvent(Component.java:6681) java.desktop/java.awt.Component.processEvent(Component.java:6405) java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5012) java.desktop/java.awt.Component.dispatchEvent(Component.java:4844) java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772) java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721) java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715) java.base/java.security.AccessController.doPrivileged(AccessController.java:391) java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95) java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745) java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743) java.base/java.security.AccessController.doPrivileged(AccessController.java:391) java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742) java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

The stack trace is not always the same. I believe the problem is always with the affected field of overlay.

esranzarnath commented 3 years ago

This appears to be issue #228

I guess the fix isn't in the release, or was undone by some later commit.

esranzarnath commented 3 years ago

My guess is this was effectively undone in 675a588b695d774b759dbb6be004fd28072b599c

tukkek commented 3 years ago

Does it crash the game or did you only notice on the logs and/or console output?

esranzarnath commented 3 years ago

It crashes the game.