mojira.dev
MC-308363

Igloo generation freezes the server in rare cases

Igloo generation with zombie villager can cause the server thread to deadlock in rare cases.

The root cause is in initializeVillagerData(), which tries to get the biome at the zombie villager’s block position. However, since the method is called from the constructor during world generation, block position is not yet set and it will always try to get the biome at (0,0,0). This leads to a deadlock during one of my normal game play.

Here is a quick way to reproduce the bug; I use a break point to catch the tight time window and mimic the OS scheduler behavior.

Requires: Vanilla 26.1.2; a dev environment that can do remote JVM debug on the game.

  1. In IDE, navigate to ZombieVillager#initializeVillagerData() and set a line breakpoint (only suspend the hit thread) at “VillagerType.byBiome(level.getBiome(…))“.

  2. Launch the game and attach the debugger to it.

  3. Set the render distance to 8 or lower. Create a world with seed -3211252110599265509

  4. Ignore some break point hits that are not related to world generation;

  5. Run “/tp @s 4300 128 -788“ and wait until the worldgen thread hits the break point.

  6. Run “/tp @s 0 128 0“ and resume the worldgen thread.

  7. Notice that the integrated server is frozen.

The screenshot shows that the integrated server stuck.

Some explanation if it may be helpful: getChunk with loadOrGenerate=false still wait for chunk futures if they are available, in this case permitted by the ticket level.

Environment

Arch Linux (unrelated, I guess)

Attachments

Comments 1

Thank you for helping us improve Minecraft! We saved your files:

[media]

InitAuther97

boq

Plausible

Platform HC

Very Important

Crash

26.1.2, 26.2 Snapshot 8

26.2 Pre-Release 2

Retrieved