terrarium-earth / Cadmus

A land claiming mod that allows users to claim land to protect your home from thieves, bandits and monsters, and admins to claim land with region flags and advanced protection!
MIT License
21 stars 8 forks source link

[Bug]: ClaimHandler.read can cause a watchdog timeout #16

Open Jamalam360 opened 11 months ago

Jamalam360 commented 11 months ago

Bug Description

The methods earth.terrarium.cadmus.common.claims.ClaimHandler.read and com.teamresourceful.resourcefullib.common.utils.SaveHandler.read can timeout the server and cause it to be killed by the watchdog.

I have specifically ran into this twice through the earth.terrarium.cadmus.common.claims.ClaimApiImpl.canDamageEntity method.

How to Reproduce?

This is how we've caused it, twice:

  1. Go into player 1's claim
  2. Get Player 2 to shoot arrows at blocks or at player 1
  3. (optional? may not be needed) get player 2 to pick up the arrows from the blocks

Expected Behavior

The method should not trigger the watchdog :laughing:

Version

1.0.0

Mod Loader Version

1.20.1 0.19.2

Mod Loader

Quilt

Logs or additional context

https://mclo.gs/luPwtPQ

Code of Conduct

ThatGravyBoat commented 11 months ago

The method that its timing out on is literally a vanilla call

Jamalam360 commented 11 months ago

OK, well that doesn't rule out Cadmus from being at fault in particular. Is there a chance that the NBT it's trying to save is huge/wrong in some other way?

ThatGravyBoat commented 11 months ago

the nbt for cadmus is very small like extremely small, its 8 bytes per chunk and then 38 bytes for the key so if you had 100k chunks thats less than an mb

Jamalam360 commented 11 months ago

This is odd then. I've done a mixin export and SavedData is clean, nothing suspicious there.

AlexNijjar commented 10 months ago

Have you ran into this any more times since the initial report? I've been unable to reproduce it, and as gravy said, it's watchdoging on a vanilla call. Perhaps one of the other mods you have installed is messing with nbt reading?

Jamalam360 commented 10 months ago

It still occurs every time the reproduction step happens, but I haven't updated the pack in a while so it might have been fixed. The mixin export didn't show anything immediately suspicious but I didn't look too deep into it