Iris Shaders

Iris Shaders

38M Downloads

Game Crashed when mixin.debug.countInjections=true

zomb-676 opened this issue · 0 comments

commented

Minecraft Version

Minecraft 1.20.1

Iris Version

iris-mc1.20-1.6.4

Sodium Version

sodium-fabric-mc1.20-0.4.10+build.27

Operating System

Windows11

What is your GPU?

Nvidia RTX 3070 Ti Laptop

Java Version

Java 18

Reproduction Steps

How to reproduce

  1. install the iris and sodium listed above
  2. add java arguments -Dmixin.debug.countInjections=true
  3. launch the game
  4. Game Crashes

Problem

as a developer, we mostly do not use -Dmixin.debug.countInjections=true
instead, we use -Dmixin.debug=true, which will also enable the countInjections
so when developers want to do some debug for mixin stuff while iris is installed, the problem will occur

Why this happened?

see the code here

@Inject(method = "renderOffsetShadow", at = @At("HEAD"), cancellable = true, require = 0, remap=false)

as the comment says: this is a mixin that is used to make iris compatible with the mod called FirstPersonModel made by tr7zw
When FirstPersonModel is not installed, the mixin won't find a property mixin target, so it will fail
Luckily, the require=0 will prevent the crash happen under most case


However, things changed when we enable countInjections directly or indirectly
as the mixin docs say here

Use this option during debugging to perform simple checking of your injectors. Causes the injector to throw a InvalidInjectionException if the expected number of injections is not realised.

so when the mod called FirstPersonModel is not installed, the countInjections enabled, the expected number doesn't satisfy the value set by default 1, so game crashed

A feasible fix

just set expect=0 for that method can fix this

Crash Report file and latest.log

some information copies from MultiMC's console
Mods:
  [✔️] iris-mc1.20-1.6.4.jar
  [✔️] sodium-fabric-mc1.20-0.4.10+build.27.jar

Params:
  --version 1.20.1 --gameDir D:/game/minecraft/mmc/instances/1.20.11/.minecraft --assetIndex 5 --uuid <PROFILE ID> --accessToken <ACCESS TOKEN> --userType msa --versionType release

Window size: 854 x 480

Java Arguments:
[-Dmixin.debug.countInjections=true, -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump, -Xms4096m, -Xmx6144m, -Duser.language=en]

---

no crash report is generated, the list below is latest.log

[22:16:59] [main/INFO]: Loading Minecraft 1.20.1 with Fabric Loader 0.14.21
[22:16:59] [main/INFO]: Loading 13 mods:
	- fabricloader 0.14.21
	- iris 1.6.4
	   |-- fabric-key-binding-api-v1 1.0.23+aaaf9d332d
	   |-- io_github_douira_glsl-transformer 2.0.0-pre13
	   |-- org_anarres_jcpp 1.4.14
	   \-- org_antlr_antlr4-runtime 4.11.1
	- java 18
	- minecraft 1.20.1
	- sodium 0.4.10+build.27
	   |-- fabric-api-base 0.4.29+b04edc7a27
	   |-- fabric-rendering-data-attachment-v1 0.3.33+b3afc78b27
	   |-- fabric-rendering-fluids-v1 3.0.26+b3afc78b27
	   \-- fabric-resource-loader-v0 0.11.7+f7923f6d27
[22:16:59] [main/INFO]: SpongePowered MIXIN Subsystem Version=0.8.5 Source=file:/D:/game/minecraft/mmc/libraries/net/fabricmc/sponge-mixin/0.12.5+mixin.0.8.5/sponge-mixin-0.12.5+mixin.0.8.5.jar Service=Knot/Fabric Env=CLIENT
[22:16:59] [main/INFO]: Compatibility level set to JAVA_16
[22:16:59] [main/INFO]: Compatibility level set to JAVA_17
[22:16:59] [main/INFO]: Loaded configuration file for Sodium: 33 options available, 3 override(s) found
[22:16:59] [main/WARN]: Force-disabling mixin 'features.entity.fast_render.MixinCuboid' as rule 'mixin.features.entity.fast_render' (added by mods [iris]) disables it and children
[22:16:59] [main/WARN]: Force-disabling mixin 'features.entity.fast_render.MixinModelPart' as rule 'mixin.features.entity.fast_render' (added by mods [iris]) disables it and children
[22:16:59] [main/WARN]: Force-disabling mixin 'features.gui.font.MixinGlyphRenderer' as rule 'mixin.features.gui.font' (added by mods [iris]) disables it and children
[22:16:59] [main/WARN]: Force-disabling mixin 'features.sky.MixinWorldRenderer' as rule 'mixin.features.sky' (added by mods [iris]) disables it and children
[22:17:02] [Datafixer Bootstrap/INFO]: 188 Datafixer optimizations took 96 milliseconds
[22:17:03] [Render thread/INFO]: Launching a new process to probe the system configuration!
[22:17:04] [Render thread/INFO]: OpenGL Vendor: NVIDIA Corporation
[22:17:04] [Render thread/INFO]: OpenGL Renderer: NVIDIA GeForce RTX 3070 Ti Laptop GPU/PCIe/SSE2
[22:17:04] [Render thread/INFO]: OpenGL Version: 3.3.0 NVIDIA 536.67
[22:17:04] [Render thread/WARN]: Enabling workaround for NVIDIA graphics drivers on Windows (issue #1486)
[22:17:04] [Render thread/WARN]: One or more workarounds were enabled to prevent crashes or other issues on your system. You may need to update your graphics drivers.
[22:17:04] [Render thread/INFO]: Environment: authHost='https://authserver.mojang.com', accountsHost='https://api.mojang.com', sessionHost='https://sessionserver.mojang.com', servicesHost='https://api.minecraftservices.com', name='PROD'
[22:17:05] [Render thread/INFO]: Setting user: zomb_676
[22:17:05] [ForkJoinPool.commonPool-worker-1/WARN]: [Iris Update Check] Failed to get update info!
javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at sun.security.ssl.Alert.createSSLException(Alert.java:131) ~[?:?]
	at sun.security.ssl.TransportContext.fatal(TransportContext.java:371) ~[?:?]
	at sun.security.ssl.TransportContext.fatal(TransportContext.java:314) ~[?:?]
	at sun.security.ssl.TransportContext.fatal(TransportContext.java:309) ~[?:?]
	at sun.security.ssl.CertificateMessage$T13CertificateConsumer.checkServerCerts(CertificateMessage.java:1351) ~[?:?]
	at sun.security.ssl.CertificateMessage$T13CertificateConsumer.onConsumeCertificate(CertificateMessage.java:1226) ~[?:?]
	at sun.security.ssl.CertificateMessage$T13CertificateConsumer.consume(CertificateMessage.java:1169) ~[?:?]
	at sun.security.ssl.SSLHandshake.consume(SSLHandshake.java:396) ~[?:?]
	at sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:480) ~[?:?]
	at sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:458) ~[?:?]
	at sun.security.ssl.TransportContext.dispatch(TransportContext.java:201) ~[?:?]
	at sun.security.ssl.SSLTransport.decode(SSLTransport.java:172) ~[?:?]
	at sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1505) ~[?:?]
	at sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1420) ~[?:?]
	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:455) ~[?:?]
	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:426) ~[?:?]
	at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:578) ~[?:?]
	at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:183) ~[?:?]
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1665) ~[?:?]
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1589) ~[?:?]
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:224) ~[?:?]
	at java.net.URL.openStream(URL.java:1161) ~[?:?]
	at net.coderbot.iris.UpdateChecker.lambda$checkForUpdates$0(UpdateChecker.java:84) ~[iris-mc1.20-1.6.4.jar:?]
	at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) ~[?:?]
	at java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1760) ~[?:?]
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) ~[?:?]
	at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) ~[?:?]
	at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) ~[?:?]
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) ~[?:?]
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) ~[?:?]
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:388) ~[?:?]
	at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:271) ~[?:?]
	at sun.security.validator.Validator.validate(Validator.java:256) ~[?:?]
	at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:231) ~[?:?]
	at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:132) ~[?:?]
	at sun.security.ssl.CertificateMessage$T13CertificateConsumer.checkServerCerts(CertificateMessage.java:1335) ~[?:?]
	... 25 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:141) ~[?:?]
	at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:126) ~[?:?]
	at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:297) ~[?:?]
	at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:383) ~[?:?]
	at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:271) ~[?:?]
	at sun.security.validator.Validator.validate(Validator.java:256) ~[?:?]
	at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:231) ~[?:?]
	at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:132) ~[?:?]
	at sun.security.ssl.CertificateMessage$T13CertificateConsumer.checkServerCerts(CertificateMessage.java:1335) ~[?:?]
	... 25 more
[22:17:05] [Render thread/INFO]: Backend library: LWJGL version 3.3.1 SNAPSHOT
[22:17:06] [Render thread/INFO]: Debug functionality is disabled.
[22:17:06] [Render thread/INFO]: ARB_direct_state_access detected, enabling DSA.
[22:17:06] [Render thread/INFO]: Shaders are disabled because no valid shaderpack is selected
[22:17:06] [Render thread/INFO]: Shaders are disabled
[22:17:06] [Render thread/ERROR]: Mixin apply for mod iris failed mixins.iris.json:MixinEntityRenderDispatcher from mod iris -> net.minecraft.class_898: org.spongepowered.asm.mixin.injection.throwables.InvalidInjectionException Injection validation failed: @Inject annotation on iris$maybeSuppressEntityShadow could not find any targets matching 'renderOffsetShadow' in net.minecraft.class_898. Using refmap iris-refmap.json [PREINJECT Applicator Phase -> mixins.iris.json:MixinEntityRenderDispatcher from mod iris -> Prepare Injections ->  -> handler$zbg000$iris$maybeSuppressEntityShadow(Lnet/minecraft/class_4587;Lnet/minecraft/class_4597;Lnet/minecraft/class_1297;FFLnet/minecraft/class_4538;FLnet/minecraft/class_243;Lorg/spongepowered/asm/mixin/injection/callback/CallbackInfo;)V -> Parse]
org.spongepowered.asm.mixin.injection.throwables.InvalidInjectionException: Injection validation failed: @Inject annotation on iris$maybeSuppressEntityShadow could not find any targets matching 'renderOffsetShadow' in net.minecraft.class_898. Using refmap iris-refmap.json [PREINJECT Applicator Phase -> mixins.iris.json:MixinEntityRenderDispatcher from mod iris -> Prepare Injections ->  -> handler$zbg000$iris$maybeSuppressEntityShadow(Lnet/minecraft/class_4587;Lnet/minecraft/class_4597;Lnet/minecraft/class_1297;FFLnet/minecraft/class_4538;FLnet/minecraft/class_243;Lorg/spongepowered/asm/mixin/injection/callback/CallbackInfo;)V -> Parse]
	at org.spongepowered.asm.mixin.injection.struct.InjectionInfo.validateTargets(InjectionInfo.java:651) ~[sponge-mixin-0.12.5+mixin.0.8.5.jar:0.12.5+mixin.0.8.5]
	at org.spongepowered.asm.mixin.injection.struct.InjectionInfo.findTargets(InjectionInfo.java:587) ~[sponge-mixin-0.12.5+mixin.0.8.5.jar:0.12.5+mixin.0.8.5]
	at org.spongepowered.asm.mixin.injection.struct.InjectionInfo.readAnnotation(InjectionInfo.java:330) ~[sponge-mixin-0.12.5+mixin.0.8.5.jar:0.12.5+mixin.0.8.5]
	at org.spongepowered.asm.mixin.injection.struct.InjectionInfo.<init>(InjectionInfo.java:316) ~[sponge-mixin-0.12.5+mixin.0.8.5.jar:0.12.5+mixin.0.8.5]
	at org.spongepowered.asm.mixin.injection.struct.InjectionInfo.<init>(InjectionInfo.java:308) ~[sponge-mixin-0.12.5+mixin.0.8.5.jar:0.12.5+mixin.0.8.5]
	at org.spongepowered.asm.mixin.injection.struct.CallbackInjectionInfo.<init>(CallbackInjectionInfo.java:46) ~[sponge-mixin-0.12.5+mixin.0.8.5.jar:0.12.5+mixin.0.8.5]
	at jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:67) ~[?:?]
	at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) ~[?:?]
	at java.lang.reflect.Constructor.newInstance(Constructor.java:483) ~[?:?]
	at org.spongepowered.asm.mixin.injection.struct.InjectionInfo$InjectorEntry.create(InjectionInfo.java:149) ~[sponge-mixin-0.12.5+mixin.0.8.5.jar:0.12.5+mixin.0.8.5]
	at org.spongepowered.asm.mixin.injection.struct.InjectionInfo.parse(InjectionInfo.java:708) ~[sponge-mixin-0.12.5+mixin.0.8.5.jar:0.12.5+mixin.0.8.5]
	at org.spongepowered.asm.mixin.transformer.MixinTargetContext.prepareInjections(MixinTargetContext.java:1329) ~[sponge-mixin-0.12.5+mixin.0.8.5.jar:0.12.5+mixin.0.8.5]
	at org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.prepareInjections(MixinApplicatorStandard.java:1053) ~[sponge-mixin-0.12.5+mixin.0.8.5.jar:0.12.5+mixin.0.8.5]
	at org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.applyMixin(MixinApplicatorStandard.java:395) ~[sponge-mixin-0.12.5+mixin.0.8.5.jar:0.12.5+mixin.0.8.5]
	at org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.apply(MixinApplicatorStandard.java:327) ~[sponge-mixin-0.12.5+mixin.0.8.5.jar:0.12.5+mixin.0.8.5]
	at org.spongepowered.asm.mixin.transformer.TargetClassContext.apply(TargetClassContext.java:421) ~[sponge-mixin-0.12.5+mixin.0.8.5.jar:0.12.5+mixin.0.8.5]
	at org.spongepowered.asm.mixin.transformer.TargetClassContext.applyMixins(TargetClassContext.java:403) ~[sponge-mixin-0.12.5+mixin.0.8.5.jar:0.12.5+mixin.0.8.5]
	at org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:363) ~[sponge-mixin-0.12.5+mixin.0.8.5.jar:0.12.5+mixin.0.8.5]
	at org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClass(MixinTransformer.java:234) ~[sponge-mixin-0.12.5+mixin.0.8.5.jar:0.12.5+mixin.0.8.5]
	at org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClassBytes(MixinTransformer.java:202) ~[sponge-mixin-0.12.5+mixin.0.8.5.jar:0.12.5+mixin.0.8.5]
	at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.getPostMixinClassByteArray(KnotClassDelegate.java:422) ~[fabric-loader-0.14.21.jar:?]
	at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.tryLoadClass(KnotClassDelegate.java:323) ~[fabric-loader-0.14.21.jar:?]
	at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.loadClass(KnotClassDelegate.java:218) ~[fabric-loader-0.14.21.jar:?]
	at net.fabricmc.loader.impl.launch.knot.KnotClassLoader.loadClass(KnotClassLoader.java:112) ~[fabric-loader-0.14.21.jar:?]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:521) ~[?:?]
	at net.minecraft.class_310.<init>(class_310.java:561) ~[client-intermediary.jar:?]
	at net.minecraft.client.main.Main.main(Main.java:211) ~[minecraft-1.20.1-client.jar:?]
	at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:468) ~[fabric-loader-0.14.21.jar:?]
	at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74) ~[fabric-loader-0.14.21.jar:?]
	at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23) ~[fabric-loader-0.14.21.jar:?]
	at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:577) ~[?:?]
	at org.multimc.onesix.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:243) ~[NewLaunch.jar:?]
	at org.multimc.onesix.OneSixLauncher.launch(OneSixLauncher.java:278) ~[NewLaunch.jar:?]
	at org.multimc.EntryPoint.listen(EntryPoint.java:143) ~[NewLaunch.jar:?]
	at org.multimc.EntryPoint.main(EntryPoint.java:34) ~[NewLaunch.jar:?]

Additional context

No response