mojira.dev
MC-262351

Worldgen deadlock caused by supporting block checks

In 23w18a there was a bug fix for MC-1133. One of the changes made to make this happen can cause a worldgen deadlock under certain conditions.

Essentially what's happening is that when an entity is loaded, it often checks for supporting blocks before their bounding box is updated to match the entity's position.
Since the supporting block check uses this bounding box to determine block collisions, this means that it will require chunks around X=0 and Z=0 to be loaded to perform this check, even if the entity is not actually being loaded there.

If this for any reason happens during world generation, such as a structure loading in with entities, this will cause a deadlock because the generating chunk is asking to load another chunk, but can itself never finish until that other chunk is loaded.

This also is not exclusively an issue with servers that disable spawn chunks from loading.
In vanilla this can be reproduced (although inconsistently) by having this happen during world initialization (preparing spawn area) - before all the spawn chunks have finished loading.

Reproduction steps:

  • Create a new world with (for ex.) seed 2374522903531219544

  • See how the process gets stuck indefinitely. (This isn't guaranteed to happen every time)

Update
I would like to add that this is not only caused by the bounding box not being updated in time. Even when the bounding box is updated before the check, and matches the correct position, this call still seems to be capable of causing a deadlock, but now because requesting chunks for collision checks seems to require the chunk to be fully loaded, which it will never be. I am not 100% sure how chunk loading works so some of this may not be accurate.

Linked issues

Attachments

Comments 4

ampolive

I was able to reproduce this first time using the provided seed, the game has stalled at 1% for several minutes.

Alec Parungao

Same as mine when I entered the seed "A dios" or 1893531048.

mickleMICKLEMIC

will changing version fix this issue on my world 

wife420

same for my world I cannot enter it anymore 22517998171852982

Wesley1808

gnembon

Confirmed

Expansion A

Very Important

Collision, Crash, World generation

23w18a

1.20 Pre-release 1

Retrieved