RelativityMC / VMP-forge

MIT License
2 stars 2 forks source link

[1.20.1] Crash when viewing a camera from the mod SecurityCraft #9

Open RedstoneDubstep opened 1 month ago

RedstoneDubstep commented 1 month ago

Describe the bug When Very Many Players is installed alongside SecurityCraft, trying to view a camera from SecurityCraft that is far away (and hence needs new chunks to load) crashes the server after a short while

To Reproduce

  1. Install SecurityCraft v1.9.11 and Very Many Players 0.2.0+beta.7.101 on your client
  2. Start the game and join a singleplayer world
  3. Teleport to a far away place (I used 1000 100 1000), place a SecurityCraft camera there and link a SecurityCraft camera monitor to it
  4. Teleport back to spawn
  5. Rightclick the camera monitor and select the linked camera
  6. Observe that the game first hangs and then crashes after a short while

Expected behavior The game would not crash, and the player's camera would move to the position of the SecurityCraft camera so the player can view the surroundings of that camera

Runtime info (please complete the following information):

Crash reports / logs Crash report: https://pastebin.com/FUmBgExD

Other mods Should be visible in the crash report; to my knowledge, only SecurityCraft and VMP modify the server in a way that is meaningful to this issue

Checklist

ishland commented 1 month ago

Try reproduce with this mod installed: https://modrinth.com/mod/uwrad/version/1.1.0+forge

RedstoneDubstep commented 1 month ago

I installed the mod, the crash occurred in the same manner as before. Log file (crash report should already be included in there): https://pastebin.com/n4jHLJFi

ishland commented 1 month ago

The only way this can happen is due to the use of unsafe threading in other mods (most likely SecurityCraft itself) that have corrupted the state vmp uses. Please consider reporting this to SecurityCraft as well.

RedstoneDubstep commented 1 month ago

I am one of the developers of SecurityCraft, and after reporting this internally we concluded that, to quote bl4ckscor3, "We're not doing anything off-thread". My personal guess is that this issue could arise from SecurityCraft trying to load and send chunks far away from the player in a faulty/unexpected way, since this crash does not occur when trying to view a SecurityCraft camera that is directly next to the player.

ishland commented 1 month ago

Cannot reproduce the crash.

RedstoneDubstep commented 1 month ago

Alright I apologize for the confusion, the crash I experienced was likely in part caused by me having WorldEdit installed as well (though now I can also no longer reproduce it, my game only starts to hang indefinitely until it runs out of memory with SC, VMP and WorldEdit). I've also now investigated why mounting the camera with SecurityCraft and VMP, while not crashing, also does not work as expected (the player stays where it was, instead of mounting the camera), and the most likely cause of that is VMP queueing the sending of newly added server entities to the client (see MixinThreadedAnvilChunkStorage#redirectUpdateOnAddEntity in VMP), so when the client wants to mount SecurityCraft's camera entity, it has not yet been sent to the client, and thus this process fails. This is something that can be fixed by SecurityCraft though, by just having the client wait until the camera entity arrives. So since the actual crash seems to be a weird 3-mod-incompatibility and not directly related to the SC+VMP interaction, feel free to close this issue if you want.