MegaMek / mekhq

MekHQ is a java helper program for the MegaMek game that allows users to load a list of entities from an XML file, perform repairs and customizations, and then save the new entities to another XML file that can be loaded into MegaMek.
http://megamek.org
131 stars 168 forks source link

Uncaught java.util.ConcurrentModificationException #4781

Open CX1237 opened 1 week ago

CX1237 commented 1 week ago

Environment

What version of MekHQ does your issue apply to? 50.0 milestone What operating system are you using? Windows, Mac, or Linux? Linux Mint22, kernel 5.15.0-119 What java version are you using? openjdk 17.0.12

Description

This first happened last night. After manually resolving a battle and starting to advance days I got an error stating : Uncaught java.util.ConcurrentModificationException

Today I reloaded the same save and got the same message.

Output from my terminal : 16:45:49,993 WARN [mekhq.campaign.personnel.generator.RandomPortraitGenerator] {AWT-EventQueue-0} mekhq.campaign.personnel.generator.RandomPortraitGenerator.generate(RandomPortraitGenerator.java:98) - Failed to generate portrait for Kotone Weng. No possible portraits found.

16:45:49,998 WARN [mekhq.campaign.personnel.generator.RandomPortraitGenerator] {AWT-EventQueue-0} mekhq.campaign.personnel.generator.RandomPortraitGenerator.generate(RandomPortraitGenerator.java:98) - Failed to generate portrait for Luke Dicker. No possible portraits found.

16:45:50,002 ERROR [mekhq.module.atb.AtBEventProcessor] {AWT-EventQueue-0} mekhq.module.atb.AtBEventProcessor.addRecruitUnit(AtBEventProcessor.java:207) - Personnel market could not find ProtoMek for recruit from faction FWL

16:45:51,133 ERROR [mekhq.MekHQ] {AWT-EventQueue-0} mekhq.MekHQ.lambda$main$1(MekHQ.java:294) - Uncaught Exception Detected java.util.ConcurrentModificationException at java.base/java.util.LinkedHashMap$LinkedHashIterator.nextNode(LinkedHashMap.java:756) at java.base/java.util.LinkedHashMap$LinkedValueIterator.next(LinkedHashMap.java:783) at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133) at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1845) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596) at mekhq.campaign.Campaign.processPersonnelRemoval(Campaign.java:3830) at mekhq.campaign.Campaign.newDay(Campaign.java:3773) at mekhq.campaign.CampaignController.advanceDay(CampaignController.java:82) at mekhq.gui.CampaignGUI.lambda$initTopButtons$62(CampaignGUI.java:1099) at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1972) at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2313) at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405) at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262) at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:279) at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:297) at java.desktop/java.awt.Component.processMouseEvent(Component.java:6626) at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3389) at java.desktop/java.awt.Component.processEvent(Component.java:6391) at java.desktop/java.awt.Container.processEvent(Container.java:2266) at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5001) at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324) at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833) at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4948) at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4575) at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4516) at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2310) at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2780) at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:775) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:720) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:714) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97) at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:747) at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:744) 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)

Files

Stallion Three30220331.cpnx.gz mekhq.log megamek.log

HammerGS commented 1 week ago

Only MekHQ related issue in above.

at mekhq.campaign.Campaign.processPersonnelRemoval(Campaign.java:3830)
at mekhq.campaign.Campaign.newDay(Campaign.java:3773)
at mekhq.campaign.CampaignController.advanceDay(CampaignController.java:82)
at mekhq.gui.CampaignGUI.lambda$initTopButtons$62(CampaignGUI.java:1099)
CX1237 commented 1 week ago

So, something went bad after I used gm-mode to remove some dependants and then advanced the time?

repligator commented 1 week ago

@CX1237 Could you please post your customs folder? I can't open your save without it.

CX1237 commented 1 week ago

@repligator

I can't seem to find any such folder. The only custom stuff I've got installed are megamek-extras-1.2 and mekhq-extras-1.1. I've moved the files inside those packs to the relevant folders in megamek.

Hope this helps.

repligator commented 1 week ago

Screenshot_20240905_195711 It looks like you customized a dropship in your campaign. Should be under Data > Mechfiles.

CX1237 commented 1 week ago

Fixed!

Union (2708) Mk II.blk.tar.gz

repligator commented 1 week ago

I'm seeing some personnel oddities here. Not sure if these are causing the bug, symptoms of it, or simply unrelated.

  1. Kasienka Gow has a role type of dependent, but is piloting a mech (and has been for about a year). Dependents can't normally be assigned to mechs.
  2. All three of the pilots on the Rolls of Honor (KIA), are listed as dependents.
  3. Lucille Segura (one of the aforementioned pilots) received a posthumous demotion to the rank of none.
CX1237 commented 1 week ago

I hope they're unrelated. 1 - set as dependent because she's preggers. 2 - set them as such since I couldn't figure out how to keep their records. 3 - demoted so all dead people share rank and thus are found in the same place on the personell roster.

CX1237 commented 1 week ago

Had this bug rear it's ugly head once again. It seems like it happens when I have operational vehicles and no way of transporting them.

Was awarded a pair of support/combat vehicles and after I hired the minimum compliment for them the game started throwing this error.