Chunks get loaded while chunks are unloading leading to potential crashes #558
Labels
F-good-issue
Flag: This is an example of a good issue report
S-confirmed
Status: Confirmed
S-fixed
Status: Fixed
Version Information
lithium-fabric-mc1.21-0.12.7
Expected Behavior
unloaded chunks should stay unloaded, not trigger game events that could potentially load them again
Actual Behavior
the chunks unload, and then enter a potentially endless loop of loading and unloading which could lead to a server crash
Reproduction Steps
build the shown setup with multiple mobs in a boat on a chunk boundry across to a chunk border with a sculk sensor next to it, flying away from this or otherwise unloading it will cause the chunks the setup occupied to then be loaded and unloaded every game tick
image from MCRcortex
Other Information
issue was orignally reported in the caffinemc discord in dev-lithium channel, following stack trace from our debug mod (yarn mappings) shows a case where this issue could potentially crash the server
CheckingLongOpenHashSet
replaces the normalLongOpenHashSet
inServerEntityManager
, and you can see thatremove
was called while in theremoveIf
functionif the call to remove shown above happens to cause the
LongOpenHashSet
to resize, the server will crash with a stack trace that looks like thisThe text was updated successfully, but these errors were encountered: