ExcessiveAmountsOfZombies / Croptopia

Fabric and Forge mod that adds crops and food to the game.
https://www.curseforge.com/minecraft/mc-mods/croptopia-fabric
MIT License
88 stars 72 forks source link

CME boot crash #517

Open ukmcplyr opened 1 year ago

ukmcplyr commented 1 year ago

Make sure you are not opening a duplicate.

Platform.

Forge

Minecraft version.

1.19.2

Croptopia version.

2.2.2

What happened?

I've hit the following crash a few dozen times whilst putting a modpack together:

[05:03:45] [modloading-worker-0/ERROR]: Exception caught during firing event: null
        Index: 1
        Listeners:
                0: NORMAL
                1: net.minecraftforge.eventbus.EventBus$$Lambda$4659/0x000000080192f7f0@69771fde
java.util.ConcurrentModificationException
[...]
[05:03:47] [Render thread/ERROR]: Reported exception thrown!
net.minecraft.ReportedException: Rendering overlay
[...]
Caused by: java.util.ConcurrentModificationException
        at java.util.HashMap$HashIterator.nextNode(HashMap.java:1597) ~[?:?]
        at java.util.HashMap$ValueIterator.next(HashMap.java:1625) ~[?:?]
        at com.google.common.collect.AbstractMapBasedMultimap.clear(AbstractMapBasedMultimap.java:275) ~[guava-31.0.1-jre.jar%23112!/:?]
        at com.google.common.collect.HashMultimap.clear(HashMultimap.java:51) ~[guava-31.0.1-jre.jar%23112!/:?]
        at com.epherical.croptopia.config.Config.initConfig(Config.java:60) ~[Croptopia-1.19.2-FORGE-2.2.2.jar%23588!/:2.2.2]
[...]

Log and crash report from a few days ago though I've hit the same CME maybe half a dozen times in the past few hours whilst chasing another bug, so it's quite easily reproducible here at least.

Relevant logs

Additional information

No response

ExcessiveAmountsOfZombies commented 1 year ago

oh fun, not even sure what would cause this.

ukmcplyr commented 1 year ago

I can try and repro with a more minimal instance in case it's some kind of mod interaction bug. Pretty sure I hit it at least once last night with a mod set of just ~60 mods.

embeddedt commented 1 year ago

Just encountered this in the ATM9 modpack. I'm wondering if it's possible under rare circumstances for Forge to send ModConfigEvent twice on different threads. This could cause one event handler to run features.clear() and the other to be running features.put at the same time.

ukmcplyr commented 1 year ago

Eep, completely forgot about this.

I know practically zero about low-level forge/java but more than happy to test anything should a fix come about. I have the modpack where I was able to hit this frequently archived away just in case.

embeddedt commented 1 year ago

In that case I'd be curious to hear if you can reproduce it at all when https://legacy.curseforge.com/minecraft/mc-mods/modernfix/files/4599348 is installed (I linked this specifically as I only added the potential fix in the latest version for each MC version).

ukmcplyr commented 1 year ago

In that case I'd be curious to hear if you can reproduce it at all when https://legacy.curseforge.com/minecraft/mc-mods/modernfix/files/4599348 is installed (I linked this specifically as I only added the potential fix in the latest version for each MC version).

So far so good! Without modernfix-forge-5.0.4+mc1.19.2.jar, I hit the CME straight away. With it, it's survived a dozen clean boots all the way to the first client tick.

embeddedt commented 1 year ago

Excellent, I was pretty sure that would fix the issue but it was coded blindly as I couldn't get it to ever happen again on my system. :laughing:

ukmcplyr commented 1 year ago

Glad I kept the pack instance around now, came very close to deleting it a few weeks ago :grin:

And thanks for the fix! :beer: