
Game crashes when reading config file
ChristopherHaws opened this issue ยท 3 comments
I am having an issue with this mod where some setting is being written to the file and from that point forward my game crashes on startup. When I delete the config files the game launches fine but eventually stops again and I have to delete the config files again.
Here is the logs:
FATAL ERROR in native method: Thread[Render thread,5,main]: No context is current or a function that is not available in the current context was called. The JVM will abort execution.
at org.lwjgl.opengl.GL20C.glCreateProgram(Native Method)
at org.lwjgl.opengl.GL20.glCreateProgram(GL20.java:211)
at fi.dy.masa.malilib.render.shader.ShaderProgram.init(ShaderProgram.java:38)
at fi.dy.masa.malilib.render.shader.ShaderProgram.<init>(ShaderProgram.java:27)
at fi.dy.masa.malilib.gui.GuiColorEditorHSV.<clinit>(GuiColorEditorHSV.java:24)
at java.lang.Class.forName0([email protected]/Native Method)
at java.lang.Class.forName([email protected]/Class.java:375)
at me.pieking1215.invmove.InvMoveConfig.readUnrecognizedConfig(InvMoveConfig.java:441)
at me.pieking1215.invmove.InvMoveConfig.load(InvMoveConfig.java:336)
at me.pieking1215.invmove.InvMove.init(InvMove.java:43)
at me.pieking1215.invmove.fabric.InvMoveFabric.onInitializeClient(InvMoveFabric.java:35)
at net.fabricmc.loader.impl.game.minecraft.Hooks$$Lambda$5060/0x00000008015a4920.accept(Unknown Source)
at net.fabricmc.loader.impl.entrypoint.EntrypointUtils.invoke0(EntrypointUtils.java:47)
at net.fabricmc.loader.impl.entrypoint.EntrypointUtils.invoke(EntrypointUtils.java:35)
at net.fabricmc.loader.impl.game.minecraft.Hooks.startClient(Hooks.java:53)
at net.minecraft.class_310.<init>(class_310.java:452)
at net.minecraft.client.main.Main.main(Main.java:197)
at java.lang.invoke.LambdaForm$DMH/0x0000000800e2c400.invokeStaticInit([email protected]/LambdaForm$DMH)
at java.lang.invoke.LambdaForm$MH/0x0000000800ebc000.invokeExact_MT([email protected]/LambdaForm$MH)
at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:460)
at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74)
at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0([email protected]/Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke([email protected]/NativeMethodAccessorImpl.java:77)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke([email protected]/DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke([email protected]/Method.java:568)
at org.multimc.onesix.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:210)
at org.multimc.onesix.OneSixLauncher.launch(OneSixLauncher.java:245)
at org.multimc.EntryPoint.listen(EntryPoint.java:143)
at org.multimc.EntryPoint.main(EntryPoint.java:34)
The config files themself look like they are valid json, so I am not sure what it causing the crash. Here are the config files that are crashing my MC:
vanilla.json:
{
"movement": {
"inventory": true,
"horseInventory": true,
"creative": true,
"crafting": true,
"chest": true,
"shulker": true,
"dispenser": true,
"hopper": true,
"enchantment": true,
"anvil": true,
"beacon": true,
"brewing": true,
"furnace": true,
"blastFurnace": true,
"smoker": true,
"loom": true,
"cartography": true,
"grindstone": true,
"stonecutter": true,
"villager": true,
"book": true,
"advancements": true
},
"backgroundHide": {
"inventory": true,
"horseInventory": true,
"creative": true,
"crafting": true,
"chest": true,
"shulker": true,
"dispenser": true,
"hopper": true,
"enchantment": true,
"anvil": true,
"beacon": true,
"brewing": true,
"furnace": true,
"blastFurnace": true,
"smoker": true,
"loom": true,
"cartography": true,
"grindstone": true,
"stonecutter": true,
"villager": true,
"book": true,
"advancements": true
}
}
unrecognized.json
{
"allowMovement": {
"net.minecraft.class_434": false,
"net.coderbot.iris.gui.screen.ShaderPackScreen": false,
"net.minecraft.class_433": false,
"com.kwpugh.simple_backpack.backpack.BackpackClientScreen": true,
"xaero.map.gui.GuiMap": false,
"xaero.map.gui.GuiWorldMapSettings": false,
"xaero.common.gui.GuiMinimapMain": false,
"xaero.common.gui.GuiWaypointSettings": false,
"net.minecraft.class_4895": false,
"me.flashyreese.mods.reeses_sodium_options.client.gui.SodiumVideoOptionsScreen": false,
"fi.dy.masa.minihud.gui.GuiConfigs": false,
"fi.dy.masa.minihud.gui.GuiShapeManager": false,
"fi.dy.masa.minihud.gui.GuiShapeEditor": false,
"eu.pb4.entityviewdistance.screen.EvdSettingsScreen": false,
"fi.dy.masa.tweakeroo.gui.GuiConfigs": false,
"fi.dy.masa.malilib.gui.GuiColorEditorHSV": false,
"fi.dy.masa.litematica.gui.GuiMainMenu": false,
"xaero.common.gui.GuiEntityRadarSettings": false
},
"hideBackground": {
"com.kwpugh.simple_backpack.backpack.BackpackClientScreen": true,
"net.minecraft.class_4895": true
}
}
cloth-config.json
{
"movement": {},
"backgroundHide": {}
}
From the logs I was able to determine that the bad config value is "fi.dy.masa.malilib.gui.GuiColorEditorHSV": false,
. After removing this line the game launches.
Hmm I see why this can crash, I have a thing here where it does Class::fromName
to get the class from the name in order to store it in a map, but I guess that class tries to load some shaders when it's loaded.
I think if I change it to use the alternate
forName(String name, boolean initialize, ClassLoader loader)
with initialize=false it should stop that from happening. Otherwise I can change it to not use forName
at all and just store strings in the map instead, should be a pretty quick fix either way