Embeddium causing concurrent access to `AbstractAirHandlingBlockEntity.airHandlerMap`
shBLOCK opened this issue ยท 0 comments
This is probably an Embeddium-only issue since it does threaded chunk updates (Chunk Render Task Executor #2
).
This seems to be quite a random and rare crash so it might not be easy to reproduce, but I think it's easy enough to make it use synchronized
blocks to access the map. It probably won't bring too much overhead but it should be tested after the change.
Here is the access that caused the exception. (I'm not sure if the other functions that access this map can also be called asynchronously)
Exception
[25Jan2024 11:00:40.593] [Chunk Render Task Executor #2/ERROR] [ChunkBuilder/]: Chunk build failed
net.minecraft.ReportedException: Encountered exception while building chunk meshes
at me.jellysquid.mods.sodium.client.render.chunk.compile.tasks.ChunkBuilderMeshingTask.fillCrashInfo(ChunkBuilderMeshingTask.java:209) ~[embeddium-0.2.16+mc1.20.1.jar%23923!/:?]
at me.jellysquid.mods.sodium.client.render.chunk.compile.tasks.ChunkBuilderMeshingTask.execute(ChunkBuilderMeshingTask.java:166) ~[embeddium-0.2.16+mc1.20.1.jar%23923!/:?]
at me.jellysquid.mods.sodium.client.render.chunk.compile.tasks.ChunkBuilderMeshingTask.execute(ChunkBuilderMeshingTask.java:50) ~[embeddium-0.2.16+mc1.20.1.jar%23923!/:?]
at me.jellysquid.mods.sodium.client.render.chunk.compile.executor.ChunkJobTyped.execute(ChunkJobTyped.java:44) ~[embeddium-0.2.16+mc1.20.1.jar%23923!/:?]
at me.jellysquid.mods.sodium.client.render.chunk.compile.executor.ChunkBuilder$WorkerRunnable.run(ChunkBuilder.java:189) ~[embeddium-0.2.16+mc1.20.1.jar%23923!/:?]
at java.lang.Thread.run(Thread.java:842) ~[?:?]
Caused by: java.util.ConcurrentModificationException
at java.util.IdentityHashMap.forEach(IdentityHashMap.java:1358) ~[?:?]
at me.desht.pneumaticcraft.common.block.entity.AbstractAirHandlingBlockEntity.m_7651_(AbstractAirHandlingBlockEntity.java:100) ~[pneumaticcraft-repressurized-6.0.13+mc1.20.1.jar%231139!/:6.0.13+mc1.20.1]
at net.minecraft.world.level.chunk.LevelChunk.m_142169_(LevelChunk.java:365) ~[client-1.20.1-20230612.114412-srg.jar%231316!/:?]
at net.minecraft.world.level.chunk.LevelChunk.m_142170_(LevelChunk.java:326) ~[client-1.20.1-20230612.114412-srg.jar%231316!/:?]
at net.minecraft.world.level.chunk.LevelChunk.m_5685_(LevelChunk.java:317) ~[client-1.20.1-20230612.114412-srg.jar%231316!/:?]
at net.minecraft.world.level.Level.m_7702_(Level.java:560) ~[client-1.20.1-20230612.114412-srg.jar%231316!/:?]
at net.minecraftforge.client.model.data.ModelDataManager.refreshAt(ModelDataManager.java:62) ~[forge-1.20.1-47.2.16-universal.jar%231321!/:?]
at net.minecraftforge.client.model.data.ModelDataManager.getAt(ModelDataManager.java:83) ~[forge-1.20.1-47.2.16-universal.jar%231321!/:?]
at net.minecraftforge.client.model.data.ModelDataManager.getAt(ModelDataManager.java:77) ~[forge-1.20.1-47.2.16-universal.jar%231321!/:?]
at appeng.block.networking.CableBusBlock.getAppearance(CableBusBlock.java:447) ~[appliedenergistics2-forge-15.0.20.jar%23775!/:15.0.20]
at net.fabricmc.fabric.api.block.v1.FabricBlockState.getAppearance(FabricBlockState.java:44) ~[fabric-block-api-v1-1.0.10+0e6cb7f777.jar%231464!/:1.0.10+0e6cb7f777]
at net.minecraftforge.common.extensions.IForgeBlockState.getAppearance(IForgeBlockState.java) ~[forge-1.20.1-47.2.16-universal.jar%231321!/:?]
at earth.terrarium.athena.api.client.forge.WrappedGetter.query(WrappedGetter.java:88) ~[athena-forge-1.20.1-3.1.1.jar%23786!/:?]
at earth.terrarium.athena.api.client.utils.CtmState$ConnectionCheck.test(CtmState.java:40) ~[athena-forge-1.20.1-3.1.1.jar%23786!/:?]
at earth.terrarium.athena.api.client.utils.CtmState.from(CtmState.java:24) ~[athena-forge-1.20.1-3.1.1.jar%23786!/:?]
at earth.terrarium.athena.impl.client.models.ConnectedBlockModel.getQuads(ConnectedBlockModel.java:44) ~[athena-forge-1.20.1-3.1.1.jar%23786!/:?]
at earth.terrarium.athena.api.client.forge.AthenaBakedModel.getModelData(AthenaBakedModel.java:72) ~[athena-forge-1.20.1-3.1.1.jar%23786!/:?]
at net.fabricmc.fabric.api.renderer.v1.model.ForwardingBakedModel.getModelData(ForwardingBakedModel.java:135) ~[fabric-renderer-api-v1-3.2.0+1d29b44577.jar%231484!/:3.2.0+1d29b44577]
at appeng.client.render.cablebus.CableBusBakedModel.getModelData(CableBusBakedModel.java:139) ~[appliedenergistics2-forge-15.0.20.jar%23775!/:15.0.20]
at net.fabricmc.fabric.api.renderer.v1.model.ForwardingBakedModel.getModelData(ForwardingBakedModel.java:135) ~[fabric-renderer-api-v1-3.2.0+1d29b44577.jar%231484!/:3.2.0+1d29b44577]
at net.fabricmc.fabric.api.renderer.v1.model.ForwardingBakedModel.getModelData(ForwardingBakedModel.java:135) ~[fabric-renderer-api-v1-3.2.0+1d29b44577.jar%231484!/:3.2.0+1d29b44577]
at me.jellysquid.mods.sodium.client.render.chunk.compile.tasks.ChunkBuilderMeshingTask.execute(ChunkBuilderMeshingTask.java:123) ~[embeddium-0.2.16+mc1.20.1.jar%23923!/:?]
... 4 more