Mojira Archive
MC-199080

Zombified piglin aggro AI hangs the server when going to another dimension

Steps to reproduce the dedicated server freeze and shutdown (not 100% reliable):

 

  1. Build platforms for zombified piglins on top of the nether at e.g. coords 1 000 000, 245, 0
  2. Use a spawn egg or wait for zombified piglins to spawn on top of them (e.g. 20 zombified piglins)
  3. Build a nether portal somewhere near (e.g. 1-3 chunks away horizontally) which the zombified piglins can't access
  4. Hit a zombified piglin to get them aggravated towards you (in survival mode)
  5. Go through the portal to overworld (may need to do multiple times)
  6. The server freezes, starts eating up memory, client times out and eventually the server is shut down. The world gets a rollback, which is easy to verify after starting the server again.

 

A video showing the reproduction process starting from joining to a server and ending with a freeze and timeout: https://www.youtube.com/watch?v=q9bE7uCpixg

 

This server freeze is relatively easy to reproduce even on vanilla survival multiplayer servers and make them to shut down/roll-back every few minutes. When using aggro-based gold farms this bug is easy to trigger accidentally. (That's how I first discovered it in 1.15.2)

 

Possible reason for the behavior: Aggravated zombified piglin calls net.minecraft.world.entity.LivingEntity::canSee to check if he can see the target player. This call traverses from piglin coords towards player coords and can load chunks while doing that. The canSee method sometimes seems to get called even after the player has changed dimensions and has been moved to new coords, which means the player coordinates can differ from the zombified piglin coordinates by millions. With a specific setup on top of the nether the canSee function may try to traverse near-horizontally through hundreds of thousands of chunks, which results in the server freeze and eventual shutdown and rollback.

 

Temp fix for gold farms: don't let the zombified piglins to stare into the abyss, put walls around it. 

 

Fixed

Tuukka Pensala

[Mojang] slicedlime

2020-08-27, 09:43 PM

2021-05-25, 03:18 PM

2021-05-25, 03:18 PM

0

1

Plausible

Very Important

Crash, Performance

mojang_internal_1

1.16.2

1.17 Pre-release 1