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.
In IDE, navigate to ZombieVillager#initializeVillagerData() and set a line breakpoint (only suspend the hit thread) at “VillagerType.byBiome(level.getBiome(…))“.
Launch the game and attach the debugger to it.
Set the render distance to 8 or lower. Create a world with seed -3211252110599265509
Ignore some break point hits that are not related to world generation;
Run “/tp @s 4300 128 -788“ and wait until the worldgen thread hits the break point.
Run “/tp @s 0 128 0“ and resume the worldgen thread.
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)
Thank you for helping us improve Minecraft! We saved your files: