Skip to content

Server hang (watchdog) when a sub-level hits crops: re-entrant Rapier call from FragileBlockCallback #1603

Open

Description

@AlbertHuangT

Context

Dedicated server hangs and is killed by the watchdog after a plane hits a field of crops.

I was flying a Create Aeronautics plane (a Sable sub-level) and crashed it into farmland full of crops. The server tick froze for 60 s and ServerHangWatchdog shut the server down. Four players were online.

The server thread is stuck in a native call. From the crash report:

Rapier3D.newVoxelCollider (Native Method)
Rapier3D.createVoxelColliderEntry (Rapier3D.java:303)
RapierVoxelColliderBakery.buildPhysicsDataForBlock / getPhysicsDataForBlock
RapierPhysicsPipeline.handleBlockChange (RapierPhysicsPipeline.java:403)
SubLevelPhysicsSystem.handleBlockChange
SableCommonEvents.handleBlockChange
LevelChunk.setBlockState (wrapped by Sable)
... Block.updateOrDestroy -> neighbour shape updates ...
Level.destroyBlock
FragileBlockCallback.onHit (FragileBlockCallback.java:55)
FragileBlockCallback.sable$onCollision
BlockSubLevelCollisionCallback.onCollision
Rapier3D.step (Native Method)
RapierPhysicsPipeline.physicsTick
SubLevelPhysicsSystem.tickPipelinePhysics

The fragile-block callback destroys the crop while Rapier3D.step is still running. The neighbour shape updates from that destruction change another block. That change goes through handleBlockChange and calls back into Rapier (newVoxelCollider) inside the same step, and the call never returns. It looks like a re-entrant native call, similar to the rope + fragile block crash fixed in 2.0.2. Deferring fragile-block destruction (or the resulting collider updates) until after step returns might avoid it.

Environment:

  • Sable 2.0.5+mc1.21.1 (sable_rapier 1.21.1-2.0.5), Sable Companion 1.6.0
  • Create Aeronautics 1.3.2, Create 6.0.10
  • Minecraft 1.21.1, NeoForge 21.1.251, Java 21.0.11 (Temurin), Linux amd64 dedicated server
  • About 60 other mods; the full list is in the crash report

Crash Report

https://mclo.gs/7sgtHZd

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