Skip to content

[Bug] Server Watchdog Crash / Deadlock during world generation when used with C2ME #145

Description

@SilkyPanda

Environment

  • Minecraft Version: 26.1.2
  • Fabric Loader: 0.19.3
  • Surveyor Version: 1.2.4+26.1
  • C2ME Version: 0.4.0-alpha.0.44+26.1.2
  • Java Version: 25

Description of the Bug

When using Surveyor alongside C2ME (Concurrent Chunk Management Engine), generating world features on background worldgen threads causes a deadlock and triggers a Minecraft Server Watchdog crash.

During structure feature placement on a C2ME worker thread (c2me-worker-0), a Point of Interest (POI) block state update triggers updatePOIOnBlockStateChange. Surveyor's handler on onPointOfInterestAdded attempts to call LandmarkComponentTypes.forBlock(), which calls Level.getChunk()/Level.getBlockState().

Because this synchronous chunk query occurs inside an off-thread world generation task, CompletableFuture.join() stalls waiting for the chunk, causing the worker thread and the server main thread to hang indefinitely until Watchdog crashes the server.

Crash Trace / Thread Dump

Relevant stack trace from worker thread c2me-worker-0:

Task trace for thread "c2me-worker-0" Id=30 (obtained on a best-effort basis)
    Sync load chunk [160, 36] to status minecraft:full in world minecraft:overworld (create=true) (1.003 min elapsed)
    Upgrading chunk [160, 36] to minecraft:features in world minecraft:overworld (1.003 min elapsed)
"c2me-worker-0" daemon prio=4 Id=30 WAITING on java.util.concurrent.CompletableFuture$Signaller@43bf18ba
	at java.base@25.0.3/jdk.internal.misc.Unsafe.park(Native Method)
	at java.base@25.0.3/java.util.concurrent.CompletableFuture.join(CompletableFuture.java:2138)
	at knot//net.minecraft.server.level.ServerChunkCache.getChunkOffThread(ServerChunkCache.java:2748)
	at knot//net.minecraft.world.level.Level.getChunk(Level.java:212)
	at knot//net.minecraft.world.level.Level.getBlockState(Level.java:9069)
	at knot//folk.sisby.surveyor.landmark.component.LandmarkComponentTypes.forBlock(LandmarkComponentTypes.java:47)
	at knot//net.minecraft.server.level.ServerLevel.mdf78614$surveyor$lambda$onPointOfInterestAdded$0$14(ServerLevel.java:19479)
	at knot//folk.sisby.surveyor.landmark.Landmark.create(Landmark.java:29)
	at knot//folk.sisby.surveyor.landmark.Landmark.global(Landmark.java:33)
	at knot//net.minecraft.server.level.ServerLevel.handler$fgg000$surveyor$onPointOfInterestAdded(ServerLevel.java:19477)
	at knot//net.minecraft.server.level.ServerLevel.updatePOIOnBlockStateChange(ServerLevel.java:1453)
	at knot//net.minecraft.server.level.WorldGenRegion.setBlock(WorldGenRegion.java:263)
	at knot//net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.placeInWorld(StructureTemplate.java:281)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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