WearBlackAllDay / DimensionalThreading

An attempt to optimize the fabric server, by assigning each dimension their own thread.
MIT License
255 stars 22 forks source link

Server crashed after entering Nether #24

Closed DaisukeVN closed 3 years ago

DaisukeVN commented 3 years ago

MC-Ver: 1.16.5

[21:52:48] [Server thread/ERROR]: Encountered an unexpected exception
net.minecraft.class_148: Exception ticking world
    at Not Enough Crashes deobfuscated stack trace.(1.16.5+build.6) ~[?:?]
    at dimthread.util.CrashInfo.crash(CrashInfo.java:28) ~[dimthread.jar:?]
    at net.minecraft.server.MinecraftServer.handler$cif000$tickWorlds(MinecraftServer:8264) ~[intermediary-minecraft_server.1.16.5.jar:?]
    at net.minecraft.server.MinecraftServer.tickWorlds(MinecraftServer:860) ~[intermediary-minecraft_server.1.16.5.jar:?]
    at net.minecraft.server.dedicated.MinecraftDedicatedServer.tickWorlds(MinecraftDedicatedServer:312) ~[?:?]
    at net.minecraft.server.MinecraftServer.tick(MinecraftServer:811) ~[intermediary-minecraft_server.1.16.5.jar:?]
    at net.minecraft.server.MinecraftServer.runServer(MinecraftServer:670) ~[intermediary-minecraft_server.1.16.5.jar:?]
    at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer:257) ~[intermediary-minecraft_server.1.16.5.jar:?]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_261]
Caused by: java.lang.ClassCastException: net.minecraft.class_2821 cannot be cast to net.minecraft.class_2818
    at Not Enough Crashes deobfuscated stack trace.(1.16.5+build.6) ~[?:?]
    at net.minecraft.world.World.getChunk(World:4226) ~[?:?]
    at net.minecraft.world.World.getBlockState(World:408) ~[?:?]
    at net.minecraft.server.world.ServerWorld.handler$zma000$tickChunk(ServerWorld:5588) ~[?:?]
    at net.minecraft.server.world.ServerWorld.tickChunk(ServerWorld:496) ~[?:?]
    at net.minecraft.server.world.ServerChunkManager.method_20801(ServerChunkManager:390) ~[?:?]
    at java.util.ArrayList.forEach(ArrayList.java:1259) ~[?:1.8.0_261]
    at net.minecraft.server.world.ServerChunkManager.tickChunks(ServerChunkManager:368) ~[?:?]
    at net.minecraft.server.world.ServerChunkManager.tick(ServerChunkManager:337) ~[?:?]
    at net.minecraft.server.world.ServerWorld.tick(ServerWorld:353) ~[?:?]
    at net.minecraft.server.MinecraftServer.mdbd1f7b$lambda$null$0$6(MinecraftServer:8254) ~[intermediary-minecraft_server.1.16.5.jar:?]
    at dimthread.DimThread.swapThreadsAndRun(DimThread.java:34) ~[dimthread.jar:?]
    at net.minecraft.server.MinecraftServer.mdbd1f7b$lambda$tickWorlds$1$5(MinecraftServer:8252) ~[intermediary-minecraft_server.1.16.5.jar:?]
    at threading.ThreadPool.lambda$null$1(ThreadPool.java:50) ~[6470db1f-aea2-4862-9f26-6a1d918d92ad.jar:?]
    at threading.ThreadPool.lambda$execute$0(ThreadPool.java:44) ~[6470db1f-aea2-4862-9f26-6a1d918d92ad.jar:?]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_261]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_261]
    ... 1 more
WearBlackAllDay commented 3 years ago

This is not a dimthread issue. You may wanna narrow down the cause, by removing mods until it disapears. The excerpt you provided will be printed on EVERY crash, if dimthread is installed, regardless of actual cause. That is because dimthread well... creates threads, thats what it does and thats what youre seeing.

ghost commented 2 years ago

I do believe the culprit is one of these 4 mods as I got the same crash report just now after I traveled to my base on the nether roof. Log: https://bytebin.lucko.me/fsndVaISEV

I'll be doing some testing and will update this report once I find some more information.

For a searchable list of the newly installed mods:

DimThread-1.2.5.jar
ferritecore-3.0.3-fabric.jar
krypton-0.1.4.jar
lazydfu-0.1.2.jar

Screen Shot 2021-10-30 at 8 28 53 PM

Edit:

For the yarn mappings for the classes in the crash report, net/minecraft/class_2821 -> net/minecraft/world/chunk/ReadOnlyChunk and net/minecraft/class_2818 -> net/minecraft/world/chunk/WorldChunk.

There's also a reference to JavaUtils in the NotEnoughCrashes popup message, so that may be related, or it may be incorrect due to the threading.

Screen Shot 2021-10-30 at 8 33 13 PM

Edit: It takes a couple of minutes after traveling to the nether for the crash to occur. From what I can tell, it doesn't trigger when spawning into the nether from world load. So, it'll take a hot minute to figure out how to reproduce it reliably and quickly.

Edit: I figured out it's related to opening block entities (so far it's only chests that crash). It's not LazyDFU like I thought it was, so off to the next mods to test.

Edit: So, other than ferritecore and dimthread, all other newly added mods were removed. I do believe I found my culprit. The interesting thing about this particular crash is, the Not Enough Crashes box didn't trigger and it instead just shut down the world. This particular crash was a StackOverflow error though. https://pastebin.com/RLX8AjF9

I also found the exact steps to trigger the crash are, enter the nether, wait a minute or two, then start opening random chests. You should crash soon.

ghost commented 2 years ago

I do believe the culprit to be FerriteCore. I don't believe FerriteCore is acting alone though as when I have all 4 mods plus the same Fabric API on a separate instance of MC, it doesn't cause any crashes. So, it's most likely a combination of mods together that causes the crash. If @DaisukeVN could send a list of mods they have, I can more accurately confirm what mod(s) are causing the issue.

The below list is the list of mods I had installed (and whether or not they were enabled/disabled) at the time of my first crash.

➜  mods ls -1
BBOutlineReloaded-2.4-1.17.1-fabric-beta2.jar
DimThread-1.2.5.jar
InventorySorter-1.8.0-1.17.jar
RoughlyEnoughItems-6.0.279-alpha-fabric.jar
TechReborn-5.0.9-beta+build.131.jar
VanitySlots-1.0.1.jar.disabled
adapaxels-1.2.1+1.17.1.jar
alexisevelyn-randomtech-0.0.14-SNAPSHOT.jar
appleskin-fabric-mc1.17-2.1.3.jar
appliedenergistics2-9.0.0-alpha.1.jar.disabled
architectury-2.5.30-fabric.jar
carpet-extra-1.17.1-1.4.43.jar.disabled
cloth-config-5.0.38-fabric.jar
continuity-1.0.0+1.17.jar
drinkbeer-v2.2+for+1.17.x.jar.disabled
extratrades-0.0.2-SNAPSHOT.jar
fabric-api-0.40.1+1.17.jar
fabric-carpet-1.17.1-1.4.46+v210918.jar
fabric-language-kotlin-1.6.5+kotlin.1.5.31.jar
ferritecore-3.0.3-fabric.jar
indium-1.0.0+mc1.17.1.jar
iris-and-sodium-mc1.17-1.1.2+build.9.jar
krypton-0.1.4.jar
lazydfu-0.1.2.jar
litematica-fabric-1.17.1-0.0.0-dev.20210906.183617.jar
lithium-fabric-mc1.17.1-0.7.4.jar
malilib-fabric-1.17.1-0.10.0-dev.25.jar
modmenu-2.0.12.jar
notenoughcrashes-3.6.5+1.17.1-fabric.jar
pipe_vacuum_pump-1.1.3.jar
reinforced-barrels-1.0.0-1.17.1.jar.disabled
rer-2.1.5.jar.disabled
simplepipes-all-0.6.1.jar
spark-fabric.jar
starlight-1.0.0+fabric.73f6d37.jar
stockpile-1.1.5+1.17.1.jar
tomsstorage-1.1.18.jar.disabled
trinkets-3.0.4.jar
villager-hats-mod-1.2.1.jar
worldedit-mod-7.2.6.jar
wthit-fabric-3.9.3.jar
ghost commented 2 years ago

I'll now be testing with all mods enabled except for DimensionalThreading and see if I can get a more accurate stacktrace (and determine whether or not it crashes at all when all dimensions are on the same thread especially since the cause of crash can be a mod or mods that don't work correctly when the dimensions are threaded).

Edit: Yep, it's a combination of mods thing. Either removing FerriteCore or DimensionalThreading prevents the crashes. I believe a third mod is also involved, but am not sure what it is.