constellation-mc / blame-log

Prepending method callers since 2023
MIT License
2 stars 0 forks source link

Instrumentation went to get some milk, but never came back... (Again?) #5

Closed tajemniktv closed 2 months ago

tajemniktv commented 2 months ago

What happened?

Hey so... Not sure where to start, but it might be that the issue (#3) is back, or at least something similar/related to this issue is happening. I had BlameLog in this instance before, so just in case I tried to remove .craker, it didn't regenerate tho (dunno if it even should regen)

The mod itself doesn't look like it's working, but might be that the below error prohibits it from working properly. Nether less, I really enjoy having a went out for milk joke in my logs lmao

[10:05:54] [main/ERROR]: (Dark Matter) [InstrumentationInternals] An error occurred during an attempt to attach an instrumentation agent.
java.lang.IllegalStateException: Failed to attach using InstrumentationImpl#loadAgent
    at me.melontini.dark_matter.impl.instrumentation.InstrumentationInternals.bootstrap(InstrumentationInternals.java:148) [dark-matter-instrumentation-4.0.1-build.481-5beaef98d63c4039.jar:?]
    at me.melontini.dark_matter.impl.instrumentation.InstrumentationInternals.<clinit>(InstrumentationInternals.java:133) [dark-matter-instrumentation-4.0.1-build.481-5beaef98d63c4039.jar:?]
    at me.melontini.dark_matter.api.instrumentation.InstrumentationAccess.canInstrument(InstrumentationAccess.java:34) [dark-matter-instrumentation-4.0.1-build.481-5beaef98d63c4039.jar:?]
    at me.melontini.blamelog.BlamePlugin.<clinit>(BlamePlugin.java:34) [blame-log-0.4.1-1.18.2-build.50.jar:?]
    at java.base/java.lang.Class.forName0(Native Method) ~[?:?]
    at java.base/java.lang.Class.forName(Class.java:529) [?:?]
    at java.base/java.lang.Class.forName(Class.java:508) [?:?]
    at net.fabricmc.loader.impl.launch.knot.MixinServiceKnot.findClass(MixinServiceKnot.java:101) [fabric-loader-0.16.0.jar:?]
    at org.spongepowered.asm.mixin.transformer.PluginHandle.<init>(PluginHandle.java:96) [sponge-mixin-0.15.0+mixin.0.8.7.jar:0.15.0+mixin.0.8.7]
    at org.spongepowered.asm.mixin.transformer.MixinConfig.onSelect(MixinConfig.java:789) [sponge-mixin-0.15.0+mixin.0.8.7.jar:0.15.0+mixin.0.8.7]
    at org.spongepowered.asm.mixin.transformer.MixinProcessor.selectConfigs(MixinProcessor.java:498) [sponge-mixin-0.15.0+mixin.0.8.7.jar:0.15.0+mixin.0.8.7]
    at org.spongepowered.asm.mixin.transformer.MixinProcessor.select(MixinProcessor.java:460) [sponge-mixin-0.15.0+mixin.0.8.7.jar:0.15.0+mixin.0.8.7]
    at org.spongepowered.asm.mixin.transformer.MixinProcessor.checkSelect(MixinProcessor.java:438) [sponge-mixin-0.15.0+mixin.0.8.7.jar:0.15.0+mixin.0.8.7]
    at org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:290) [sponge-mixin-0.15.0+mixin.0.8.7.jar:0.15.0+mixin.0.8.7]
    at org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClass(MixinTransformer.java:234) [sponge-mixin-0.15.0+mixin.0.8.7.jar:0.15.0+mixin.0.8.7]
    at org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClassBytes(MixinTransformer.java:202) [sponge-mixin-0.15.0+mixin.0.8.7.jar:0.15.0+mixin.0.8.7]
    at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.getPostMixinClassByteArray(KnotClassDelegate.java:422) [fabric-loader-0.16.0.jar:?]
    at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.tryLoadClass(KnotClassDelegate.java:323) [fabric-loader-0.16.0.jar:?]
    at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.loadClass(KnotClassDelegate.java:218) [fabric-loader-0.16.0.jar:?]
    at net.fabricmc.loader.impl.launch.knot.KnotClassLoader.loadClass(KnotClassLoader.java:119) [fabric-loader-0.16.0.jar:?]
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525) [?:?]
    at java.base/java.lang.Class.forName0(Native Method) ~[?:?]
    at java.base/java.lang.Class.forName(Class.java:529) [?:?]
    at java.base/java.lang.Class.forName(Class.java:508) [?:?]
    at net.fabricmc.loader.impl.util.DefaultLanguageAdapter.create(DefaultLanguageAdapter.java:50) [fabric-loader-0.16.0.jar:?]
    at net.fabricmc.loader.impl.entrypoint.EntrypointStorage$NewEntry.getOrCreate(EntrypointStorage.java:117) [fabric-loader-0.16.0.jar:?]
    at net.fabricmc.loader.impl.entrypoint.EntrypointContainerImpl.getEntrypoint(EntrypointContainerImpl.java:53) [fabric-loader-0.16.0.jar:?]
    at net.fabricmc.loader.impl.FabricLoaderImpl.invokeEntrypoints(FabricLoaderImpl.java:399) [fabric-loader-0.16.0.jar:?]
    at net.fabricmc.loader.impl.launch.knot.Knot.init(Knot.java:160) [fabric-loader-0.16.0.jar:?]
    at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:68) [fabric-loader-0.16.0.jar:?]
    at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23) [fabric-loader-0.16.0.jar:?]
    at org.prismlauncher.launcher.impl.StandardLauncher.launch(StandardLauncher.java:100) [NewLaunch.jar:?]
    at org.prismlauncher.EntryPoint.listen(EntryPoint.java:129) [NewLaunch.jar:?]
    at org.prismlauncher.EntryPoint.main(EntryPoint.java:70) [NewLaunch.jar:?]
Caused by: java.lang.RuntimeException: Failed to define me.melontini.dark_matter.impl.instrumentation.AgentProvider
    at me.melontini.dark_matter.impl.instrumentation.InstrumentationInternals.unsafeAttach(InstrumentationInternals.java:168) ~[dark-matter-instrumentation-4.0.1-build.481-5beaef98d63c4039.jar:?]
    at me.melontini.dark_matter.impl.instrumentation.InstrumentationInternals.bootstrap(InstrumentationInternals.java:146) ~[dark-matter-instrumentation-4.0.1-build.481-5beaef98d63c4039.jar:?]
    ... 33 more
[10:05:54] [main/ERROR]: [BlameLog] Instrumentation went to get some milk, but never came back...

Logs

Full log: https://mclo.gs/Sndqf70

Version

0.4.1-1.18.2-build.50 (On MC 1.21)

melontini commented 2 months ago

Hi, thanks for the report. This somehow slipped through my tests, but is now fixed!

dunno if it even should regen

It shouldn't. The latest version uses a temporary file instead.

tajemniktv commented 2 months ago

Appreciate the quick fix and even quicker response!:)

Also, just fyi - this mod can be a godsend in debugging, especially with lots of mods. The fact that it isn't more popular or that it's "just a proof of concept" and hasn't been done before, makes you a wizard. I believe it should be included in every mod loader, either as a default thing or as a toggle setting (maybe worth thinking about suggesting this or PRing this to fabric if it's possible?)

Many thanks for your work!

melontini commented 2 months ago

Thank you for the high praise!

The reality of it is, is that the mod uses some pretty unsafe and unsupported techniques to do what it does (Java 22+ will make this even more unsupported, lol). Deploying it Fabric-wide would be dangerous.

I think there's a safer way to do this, but I haven't looked into that too much.

melontini commented 2 months ago

Fixed in latest.