RoughlyEnoughResources icon indicating copy to clipboard operation
RoughlyEnoughResources copied to clipboard

Server crashes due to this mod

Open Romz24 opened this issue 4 years ago • 10 comments

My server crashes because of this mod, when I uninstall it the problem disappears. Doesn't this mod require it to be installed on both server and client at the same time? If ore generation or the extraction of certain items is changed on the server, won't this mod inform the client about this?

Minecraft version: 1.16.3 Mod version: 2.1.2 Fabric API: 0.24.1+build.412-1.16 Fabric loader: 0.10.3+build.211

crash-2020-10-27_17.57.49-server.txt

Romz24 avatar Oct 27 '20 15:10 Romz24

error in this code:

https://github.com/theorbtwo/RoughlyEnoughResources/blob/1.16.2/src/main/java/uk/me/desert_island/rer/WorldGenState.java#L134-L160

Romz24 avatar Oct 27 '20 17:10 Romz24

exactly the same problem here, on minecraft 1.16.4 crash-2020-11-21_19.30.04-server.txt

Molier avatar Nov 21 '20 18:11 Molier

I'm getting a very similar error:

Description: Exception ticking world java.lang.NullPointerException: Cannot invoke "it.unimi.dsi.fastutil.ints.IntArrayList.getInt(int)" because "this.wrapped" is null

crash-2020-11-21_17.23.37-server.txt

wmboeckman avatar Nov 25 '20 06:11 wmboeckman

I did some digging and it seems to be caused by concurrent access to WorldGenState#playerDirty during chunk generation and tick. I added a ReentrantLock to WorldGenState#toNetwork and WorldGenState#markPlayerDirty and can't reproduce the crash anymore; Though i could just be getting lucky.

Also using https://pastebin.com/uMkibrcb i was able to produce a crash reliably.

biom4st3r avatar Nov 29 '20 05:11 biom4st3r

@biom4st3r Can you share the fix code?

Romz24 avatar Nov 29 '20 12:11 Romz24

Oh, thank you much, @biom4st3r? I'd love a pull request with that.

theorbtwo avatar Dec 03 '20 02:12 theorbtwo

Can do

biom4st3r avatar Dec 03 '20 03:12 biom4st3r

Just got this issue while ~~exploring in the Nether~~ nevermind, it seems reproducible by taking Arrow (Instant Harming II) out of any Nether Temple dispenser from Repurposed Structures:

[12:17:58] [Server thread/ERROR]: Encountered an unexpected exception
net.minecraft.class_148: Exception ticking world
	at Not Enough Crashes deobfuscated stack trace.(1.16.4+build.7) ~[?:?]
	at net.minecraft.server.MinecraftServer.tickWorlds(MinecraftServer:875) ~[intermediary-server.jar:?]
	at net.minecraft.server.dedicated.MinecraftDedicatedServer.tickWorlds(MinecraftDedicatedServer:312) ~[?:?]
	at net.minecraft.server.MinecraftServer.tick(MinecraftServer:811) ~[intermediary-server.jar:?]
	at net.minecraft.server.MinecraftServer.handler$zpi000$modifiedRunLoop(MinecraftServer:7810) ~[intermediary-server.jar:?]
	at net.minecraft.server.MinecraftServer.runServer(MinecraftServer:651) ~[intermediary-server.jar:?]
	at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer:257) ~[intermediary-server.jar:?]
	at java.lang.Thread.run(Unknown Source) [?:?]
Caused by: java.lang.NullPointerException
	at Not Enough Crashes deobfuscated stack trace.(1.16.4+build.7) ~[?:?]
	at it.unimi.dsi.fastutil.ints.IntOpenHashSet$SetIterator.nextInt(IntOpenHashSet.java:464) ~[intermediary-server.jar:?]
	at it.unimi.dsi.fastutil.ints.IntIterator.next(IntIterator.java:43) ~[intermediary-server.jar:?]
	at it.unimi.dsi.fastutil.ints.IntIterator.next(IntIterator.java:26) ~[intermediary-server.jar:?]
	at uk.me.desert_island.rer.WorldGenState.toNetwork(WorldGenState.java:144) ~[rer-2.1.2.jar:?]
	at net.minecraft.server.MinecraftServer.handler$zkm000$tickWorlds(MinecraftServer:6234) ~[intermediary-server.jar:?]
	at net.minecraft.server.MinecraftServer.tickWorlds(MinecraftServer:871) ~[intermediary-server.jar:?]
	... 6 more

It seems like there's a fix, can we get a CurseForge release with the fix included?

magneticflux- avatar Dec 05 '20 12:12 magneticflux-

Yeah, @biom4st3r's fix seems to work for me as well. Definitely should be part of a bug fix release.

wmboeckman avatar Dec 06 '20 06:12 wmboeckman

any news? I often get this error now in my 1.17.1 modpack.

MSandro avatar Dec 22 '21 16:12 MSandro