Farsight [Fabric]

Farsight [Fabric]

9M Downloads

[Bug]: crashed while loading farsight with my modpack

bertitah opened this issue ยท 7 comments

commented

Describe the bug you're experiencing

I was loading Minecraft and I added farsight and it crashed.

Reproducability

Crash log:

Minecraft has crashed!
net.fabricmc.loader.impl.FormattedException: java.lang.RuntimeException: Mixin transformation of me.jellysquid.mods.sodium.client.gui.SodiumGameOptionPages failed
at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:463)
at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74)
at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)
Caused by: java.lang.RuntimeException: Mixin transformation of me.jellysquid.mods.sodium.client.gui.SodiumGameOptionPages failed
at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.getPostMixinClassByteArray(KnotClassDelegate.java:427)
at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.tryLoadClass(KnotClassDelegate.java:323)
at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.loadClass(KnotClassDelegate.java:218)
at net.fabricmc.loader.impl.launch.knot.KnotClassLoader.loadClass(KnotClassLoader.java:112)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:467)
at net.fabricmc.loader.impl.launch.knot.MixinServiceKnot.findClass(MixinServiceKnot.java:96)
at org.spongepowered.asm.mixin.transformer.MixinProcessor.audit(MixinProcessor.java:254)
at org.spongepowered.asm.mixin.transformer.MixinTransformer.audit(MixinTransformer.java:171)
at org.spongepowered.asm.mixin.MixinEnvironment.audit(MixinEnvironment.java:1425)
at ca.fxco.memoryleakfix.MemoryLeakFix.forceLoadAllMixinsAndClearSpongePoweredCache(MemoryLeakFix.java:30)
at net.minecraft.client.main.Main.handler$cph000$loadAllMixinsThenShouldRenderAsync(Main.java:1026)
at net.minecraft.client.main.Main.method_44604(Main.java:220)
at net.minecraft.client.main.Main.main(Main.java:51)
at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:461)
... 2 more
Caused by: org.spongepowered.asm.mixin.transformer.throwables.MixinTransformerError: An unexpected critical error was encountered
at org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:392)
at org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClass(MixinTransformer.java:234)
at org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClassBytes(MixinTransformer.java:202)
at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.getPostMixinClassByteArray(KnotClassDelegate.java:422)
... 17 more
Caused by: org.spongepowered.asm.mixin.injection.throwables.InjectionError: Critical injection failure: Constant modifier method initCompat(I)I in farsight.mixins.json:SodiumGameOptionPagesMixin from mod farsight failed injection check, (0/1) succeeded. Scanned 1 target(s). Using refmap farsight-fabric-refmap.json
at org.spongepowered.asm.mixin.injection.struct.InjectionInfo.postInject(InjectionInfo.java:468)
at org.spongepowered.asm.mixin.transformer.MixinTargetContext.applyInjections(MixinTargetContext.java:1385)
at org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.applyInjections(MixinApplicatorStandard.java:1052)
at org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.applyMixin(MixinApplicatorStandard.java:400)
at org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.apply(MixinApplicatorStandard.java:325)
at org.spongepowered.asm.mixin.transformer.TargetClassContext.apply(TargetClassContext.java:421)
at org.spongepowered.asm.mixin.transformer.TargetClassContext.applyMixins(TargetClassContext.java:403)
at org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:363)
... 20 more

Mod up to date

  • Before submitting this issue I updated to the newest version and reproduced it

Minecraft version

1.19

Modloader version

Fabric

Logs

https://gist.github.com/bertitah/17e9a96ce35aad9bb4555e00b4a2d3c5

commented

Found the error. Incompatibility with the mod MemoryLeakFix.

commented

in this case its two mods modifying the same constant (32-render distance) to increase it, ofc one of them will do it first and the other then runs into a conflict which is normally solved by mixin's own conflict handling, unless memory leak is there.

Now ofc ideally there would never be any conflict, but its hardly doable to add mixin plugin compat for every potential conflict to avoid the mixin conflict handling

commented

Incorrect, farsight does an invalid mixin into the sodium settings. When its not successful it fails, this should be managed through a mixin plugin.
MemoryLeakFix loads all valid mixins when the game starts, which shows underlying issues in mixins that need to be fixed.

commented

It actually is a perfectly fine mixin, from what I can see it is memory leak fix not beeing able to handle conflicting mixins, as in this case two mods mixin into the same place( farsight and c2me). Normally its not an issue as farsight's mixins all are marked as non required and thus do not crash, but memoryleak fix can't handle it for some reason.

I'm pretty sure its memory leak fix causing issues here, force-loading all mixins and their respective classes is quite error prone as its messing with the natural order classes are loaded in which some mods may rely on.

You can see the mixin here: https://github.com/someaddons/farsight/blob/1.19Fabric/src/main/java/farsight/mixin/SodiumGameOptionPagesMixin.java
@FxMorin feel free to show me where that one is going wrong :)

commented

So far from the 3+ million downloads. I've yet to see a mixin order loading bug.
I was originally expecting to see loads of them, however it turns out that the order in which mixins load is not very problematic.

With your two mixins, I'm not sure how they work however I'm guessing one of the injection locations does not exist at runtime under certain conditions.
Injection checks are still done when force loading mixins, even if they are not required.
Best solution would be to only load that mixin if the correct conditions are met, using a mixin plugin. (Personally I like conditional-mixin)

commented

However this may also be a none issue.
I will no longer be forcing mixins to load, from fabric-loader v0.14.15 since the memory leak has been fixed by fabric.

MemoryLeakFix is currently undergoing a major rewrite, so once that's done, force loading will be disabled past that version

commented

fixed in newer memory leak versions