SpongePowered / Mixin

Mixin is a trait/mixin and bytecode weaving framework for Java using ASM
MIT License
1.4k stars 192 forks source link

Mixins with DCEVM hang on hotswap. #592

Open codecnotsupported opened 2 years ago

codecnotsupported commented 2 years ago

The fabric wiki Mentions that "When run on JetBrains Runtime's Java 17 fork (with DCEVM), Mixin hotswapping and DCEVM work properly."

There are two ways to use DCEVM with java 17.

Setup: java VM arguments:

-XX:HotswapAgent=fatjar ( Only applicable for option A )
-XX:+AllowEnhancedClassRedefinition  
-javaagent:"path_to/sponge-mixin-0.11.2+mixin.0.8.5.jar"

When hotswapping it prints: [JDWP Transport Listener: dt_socket/INFO]: Redefining mixin com/example/example_mod/mixin/ArrowEntityMixin Then the loading bar in InteliJ Idea just hangs.

Other observations:

Hotswap agent has suppport for plugins But I don't think Mixin takes advantage of that?

codecnotsupported commented 2 years ago

It seems merely using JetBrainsRuntime JDK with -XX:+AllowEnhancedClassRedefinition is enough to make the hotswap task hang, meaning HotswapAgent is probably not the cause.

Barteks2x commented 2 years ago

This definitely used to work on java 8 dcevm on 1.12.2. On newer versions on modlauncher the only time o tried, it didn't yet work (classloading issue on hotswap attempt).

MDevVal commented 1 year ago

With or without hotspot agent loaded on jbr_17 -XX:+AllowEnhancedClassRedefinition -javaagent:"sponge-mixin-0.12.5+mixin.0.8.5.jar" hangs for me

norpie commented 11 months ago

Has anyone found a fix for this?

Floweynt commented 5 months ago

Has anyone found a fix for this?

It seems like downgrading JBR works: https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr17_0_1b164.8

ButterSus commented 1 month ago

Downgrading JBR doesn't help in my case. Seems like hotswapping mixins is broken for Java 17+. Hope this will get fixed.