I've had this crash dozens of times throughout 1.16.x (and possibly earlier) on my public vanilla server. It's not easy to reproduce as it does not happen frequently, but every time it does happen it's because a player has teleported away from an area while there were mobs aggroed by him, as far as I can tell always zombified piglins.
There are 2 teleportation mechanisms on the server, both can trigger this crash:
1 - summon an armorstand, execute a function as that armorstand which sets its Pos field and then teleports the player in question to itself.
2 - teleport to another player directly through functions.
When crashing, the server takes takes 60 seconds until it times out. I have attached 4 de-obfuscated crash reports. I can provide more if necessary, but they all follow a similar pattern.
Edit: Was able to reproduce it.Β https://www.youtube.com/watch?v=DFa4wSobUY8
Linked issues
Attachments
Comments 14
What on earth are you talking about? No it does not shut down because of too much lag. The server runs perfectly fine until it suddenly stops responding and the watchdog kills it exactly 60 seconds after the teleport.
In two of the crashes I've attached there is a single person online running a run-of-the-mill gold farm, the TPS was most certainly at 20 until the second the player teleports away.
Does MC-63590 describe your issue?
No. It doesn't. Just read the crash dump: they all have an almost identical stack trace with the commonality that a zombified piglin tries to pathfind and that function call takes more than 60 seconds to complete, exceeding the watchdog timer.
Linking some other random report does not help, and this is frankly starting to feel insulting...
Does the issue happen without having any datapacks enabled? If not, please attach the affected data pack. It has probably some error that causes the function to loop indefinitely.
Deobfuscating
, I get this:
java.lang.Error: Watchdog
at sun.misc.Unsafe.park(Native Method)
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
at net.minecraft.util.thread.BlockableEventLoop.waitForTasks(SourceFile:139)
at net.minecraft.util.thread.BlockableEventLoop.managedBlock(SourceFile:129)
at net.minecraft.server.level.ServerChunkCache.getChunk(SourceFile:141)
at net.minecraft.world.level.Level.getChunk(SourceFile:209)
at net.minecraft.world.level.LevelReader.getChunk(SourceFile:128)
at net.minecraft.world.level.Level.getChunk(SourceFile:204)
at net.minecraft.world.level.Level.getBlockState(SourceFile:408)
at net.minecraft.world.level.BlockGetter.lambda$clip$0(SourceFile:59)
at net.minecraft.world.level.BlockGetter$$Lambda$4112/1916329321.apply(Unknown Source)
at net.minecraft.world.level.BlockGetter.traverseBlocks(SourceFile:181)
at net.minecraft.world.level.BlockGetter.clip(SourceFile:58)
at net.minecraft.world.entity.LivingEntity.canSee(SourceFile:2717)
at net.minecraft.world.entity.ai.sensing.Sensing.canSee(SourceFile:32)
at net.minecraft.world.entity.ai.goal.MeleeAttackGoal.tick(SourceFile:112)
at net.minecraft.world.entity.ai.goal.ZombieAttackGoal.tick(SourceFile:28)
at net.minecraft.world.entity.ai.goal.WrappedGoal.tick(SourceFile:55)
at net.minecraft.world.entity.ai.goal.GoalSelector$$Lambda$3810/1313955901.accept(Unknown Source)
at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
at java.util.Iterator.forEachRemaining(Iterator.java:116)
at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
at net.minecraft.world.entity.ai.goal.GoalSelector.tick(SourceFile:88)
at net.minecraft.world.entity.Mob.serverAiStep(SourceFile:736)
at net.minecraft.world.entity.LivingEntity.aiStep(SourceFile:2508)
at net.minecraft.world.entity.Mob.aiStep(SourceFile:542)
at net.minecraft.world.entity.monster.Monster.aiStep(SourceFile:43)
at net.minecraft.world.entity.monster.Zombie.aiStep(SourceFile:260)
at net.minecraft.world.entity.LivingEntity.tick(SourceFile:2254)
at net.minecraft.world.entity.Mob.tick(SourceFile:342)
at net.minecraft.world.entity.monster.Zombie.tick(SourceFile:233)
at net.minecraft.server.level.ServerLevel.tickNonPassenger(SourceFile:621)
at net.minecraft.server.level.ServerLevel$$Lambda$3788/19259337.accept(Unknown Source)
at net.minecraft.world.level.Level.guardEntityTick(SourceFile:561)
at net.minecraft.server.level.ServerLevel.tick(SourceFile:411)
at net.minecraft.server.MinecraftServer.tickChildren(SourceFile:871)
at net.minecraft.server.dedicated.DedicatedServer.tickChildren(SourceFile:312)
at net.minecraft.server.MinecraftServer.tickServer(SourceFile:811)
at net.minecraft.server.MinecraftServer.runServer(SourceFile:670)
at net.minecraft.server.MinecraftServer.spin(SourceFile:257)
at net.minecraft.server.MinecraftServer$$Lambda$3346/1771305569.run(Unknown Source)
at java.lang.Thread.run(Thread.java:748)
is the same, while
and
are slightly different (they're missing ZombieAttackGoal.tick
and Zombie.tick
, and have EnderMan.aiStep
(bdg.k
) instead of Zombie.aiStep
). But they both share MeleeAttackGoal
, which makes sense (ZombieAttackGoal
is a subclass of it). Note that Zombie.tick
showing up is consistent with it being zombified piglen, as ZombifiedPiglin
subclasses Zombie
and doesn't have its own tick
or aiStep
.
MeleeAttackGoal.tick
first checks if the attacking entity can see its target. It does this through Sensing.canSee
, which calls LivingEntity.canSee
which performs a ray-trace. Sensing
does appear to have some form of caching, but it looks like it's cleared every tick. The actual ray-tracing doesn't seem to have any dimension checks (it always uses the attacker's world), nor does it make some kind of sanity check as to the distance between entities; based on the crash reports, it looks like this ray-tracing is able to load chunks. MeleeAttackGoal.tick
does check the distance between entities, but only uses it to update a counter (ticksUntilNextPathRecalculation
) for performing pathfinding and still performs the ray-trace each tick. The path-finding is much more expensive compared to the ray-trace, but if either are loading chunks, it's still super expensive, and I don't see a reason why it shouldn't check the counter first. Checking the counter first wouldn't solve this problem, but it would still reduce the number of ray-traces.
I'm guessing that the following are needed to reproduce this bug:
A large number of mobs with the ability to agro on a player, even if they can't pathfind to them (i.e. the mob farm must store mobs in such a way that they can see the player; no dropping them onto a slab where you attack them from below out of sight).
A teleportation destination where a ray-trace from the mob's eyes to the player's coordinates doesn't immediately hit an obstruction (and furthermore goes into unloaded chunks). For something in the nether, this probably means a farm above a large lava lake, along with a holding pen that doesn't obstruct the mob's eyes.
A situation in which the mobs will stay loaded even though the player has teleported away, or at least will perform a single tick after the player has teleported away (I don't know the details of chunk loading or ticking, so I can't say whether this is rare or common).
I think that placing a large number of mobs in spawn chunks in a superflat world, letting them agro, and then teleporting away will be enough to reproduce this issue. I'll test it, but for now, this issue is at least plausible enough for me to re-open it.
Some additional questions:
When players teleport, are they going from the nether to the overworld? Or to another location in the nether? About how far away would these distances be? (Similarly, for the nether portal case, how far away is the corresponding portal in the overworld? It'd be about 7 times the coordinates in the nether, I reckon.)
Am I correct about mobs having a wide line of sight from wherever the farm stores them?
Tested it according to instructions and it does work (https://www.youtube.com/watch?v=DFa4wSobUY8). It's a superflat world opened in LAN with a second player loading the area, as I found that /forceload does not seem to be enough to trigger it, or at least with a much lower probability.
As you can see in the footage the 'Client Chunk Cache' counts up rapidly as it not only tries to load the chunks in the path to the player, but actively generates missing ones. Since it will happily do this forever though, I don't get a crash-dump using this setup, however it does trigger consistently.
This might be the same issue as MC-202249?
The server shuts down automatically because of too much lag.
We do not have enough information to find the cause of this issue.
While the lag occurs, please run
/debug start
, wait a while and then run/debug stop
in order to create a debug profile. Afterwards, run/debug report
.If you do not have the permission to run these commands, open your world to LAN and enable cheats. If you're on a server, make sure that you're a server operator in order to execute these commands.
Then, please attach the profile results found in
[minecraft/debug/profile-results-<DATE>.txt|https://minecrafthopper.net/help/finding-minecraft-data-folder/]
, as well as the debug report found in[minecraft/debug/debug-report-<DATE>.zip|https://minecrafthopper.net/help/finding-minecraft-data-folder/]
here.This issue is being temporarily closed as Awaiting Response. Once the requested information has been delivered, the report will be reopened automatically.
Quick Links:
π Bug Tracker Guidelines β π¬ Community Support β π§ Mojang Support
π Project Summary β βοΈ Feedback and Suggestions β π Game Wiki