Reika_Mods_Issues
Reika_Mods_Issues copied to clipboard
Crash when opening Rotarycraft/Reactorcraft GUI
Every once in a while when opening up a GUI from Rotary/Reactorcraft I get this crash
crash-2017-02-22_18.00.35-server.txt
Doesn't seem to have any consistent pattern and it isn't really worldbreaking or anything but it is rather annoying to be forced to reboot my game out of the blue
Uploaded to Gist:
https://gist.github.com/DaMachinator/e92b442795e4e9a556a3ad893f060ad4
What are you holding when it crashes? If it is a TiCon tool, what is in the adjacent slots?
There seems to be no consistency. Once it's crashed while I was handling nuclear waste and putting it into a spent fuel container, another time it crashed when opening a fission reactor core with a steam boiler in hand, I've even had it crash while opening a reservoir GUI with flint and steel in hand.
So I'm not quite sure where the problem stems from, I only know that it occurs randomly when opening up a Rotary/Reactorcraft GUI.
This crash isn't new, but it happening with Rotarycraft/Reactorcraft items is new...
https://github.com/ReikaKalseki/Reika_Mods_Issues/issues/652, https://github.com/ReikaKalseki/Reika_Mods_Issues/issues/590, https://github.com/ReikaKalseki/Reika_Mods_Issues/issues/855, https://github.com/ReikaKalseki/Reika_Mods_Issues/issues/161
That is a long-time vanilla MC bug, was not fixed in 1.8 either, unsure about after that. There was a mini-mod going around at some point that ASM'd it fixed but unable to find it from a cursory Google search.
There are certain things mods can do to more rapidly cause it, but it is still a vanilla bug.
I suspect this is the following bug: https://github.com/MinecraftForge/MinecraftForge/issues/1354 (fixed in Forge for Minecraft 1.8.9 only) Because I was able to reproduce the crash pretty consistently in my world, and after applying a bytecode patch that corresponds to the fix, the crash stopped.
Bytecode patch, for the reference: nh.diff.txt
Hmm ,interesting, this is a patch that could be added to DragonAPI.
Changing branching logic through ASM is a bit of a nightmare (especially in methods full of such logic). What exactly does the fix entail?
With branches have to keep StackMaps in mind. ASM has a way to generate those automatically.
Basically, if playerEntity.openContainer.getSlotFromInventory() returns null, use playerEntity.inventoryContainer.getSlotFromInventory() instead.
As I returned to play with Reika's mods, I took a look at this again.
Using Krakatau, I was able to play without this bug by patching nh.class in 1.7.10.jar with the diff posted above (and of course adding java arguments -Dfml.ignorePatchDiscrepancies=true -Dfml.ignoreInvalidMinecraftCertificates=true)
But looking at more accepted ways to do this, found that Battlegear2 from GTNH has the same NetHandlerPlayServer NPE fix: https://github.com/GTNewHorizons/Battlegear2/commit/f0b5cabfcfc04d8359909d5f108f2d155b878486
So the problem can be fixed simply by adding these mods from GTNH: +unimixins-all-1.7.10-0.1.14.jar battlegear2-1.3.0.jar