Skip to content

ConcurrentModificationException in TileStreamUpdateTracker.syncVisualUpdates (Forestry 2.6.2, MC 1.20.1) #264

@Wor1dEdiT-bg

Description

@Wor1dEdiT-bg

Description

Game crashes with a java.util.ConcurrentModificationException during client tick when Forestry’s TileStreamUpdateTracker runs.
Crash seems tied to Forestry tile entities updating visuals (apiaries/machines/etc.) in loaded chunks.

Embeddium marks the instance “tainted” but stacktrace points directly to Forestry’s TileStreamUpdateTracker.

Crash report

Full log java.util.ConcurrentModificationException: null at java.util.HashMap$HashIterator.nextNode(HashMap.java:1597) ~[?:?] {} at java.util.HashMap$KeyIterator.next(HashMap.java:1620) ~[?:?] {} at forestry.core.blocks.TileStreamUpdateTracker.syncVisualUpdates(TileStreamUpdateTracker.java:38) ~[forestry-1.20.1-2.6.2.jar%23766!/:2.6.2] {re:classloading} at forestry.core.ModuleCore.onLevelTick(ModuleCore.java:151) ~[forestry-1.20.1-2.6.2.jar%23766!/:2.6.2] {re:classloading} at net.minecraftforge.eventbus.EventBus.doCastFilter(EventBus.java:260) ~[eventbus-6.0.5.jar%2387!/:?] {} ...
Environment

Minecraft: 1.20.1

Forge: 47.4.0

Forestry CE: 2.6.2

Java: 17

Other performance mods present: Embeddium, Oculus, ModernFix, SodiumDynamicLights, Fusion, Supplementaries.
(Crash still points to Forestry core, not renderer.)

Steps to Reproduce

Load a world with Forestry tiles (apiary/machines/farms).

Play for a while → eventually crash occurs.

In my case, near x=69, y=59, z=89 (chunk 4,5).

Crash log shows CME in TileStreamUpdateTracker.syncVisualUpdates.

Additional notes

Looks like a thread-safety / iteration modification issue: HashMap is being mutated while Forestry is iterating during visual update sync.

Disabling ModernFix’s concurrency mixins reduces frequency but doesn’t fix root cause.

Clearing the offending chunk or removing Forestry tiles allows world to load again.

Expected Behavior

Forestry’s visual update tracker should handle updates safely without throwing a CME.

This report was made use GPT ;)

Had this happen multiple times over many sessions, and the reason I tried pulling a fork. Did not have the time to look further hope it helps, if not delete, or remove the post alt right

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions