Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deadlock in MixinBootstrap.init(); #685

Open
Splatcrafter opened this issue Dec 15, 2024 · 2 comments
Open

Deadlock in MixinBootstrap.init(); #685

Splatcrafter opened this issue Dec 15, 2024 · 2 comments

Comments

@Splatcrafter
Copy link

Splatcrafter commented Dec 15, 2024

Hello,

I'm trying to use Mixin as a Java agent to create a custom usage for all Minecraft client versions, including customized ones like LabyMod, Feather, Vanilla, etc., since they are most likely to use the same obfuscated client code as Vanilla.

Currently, I'm facing an issue where the agent freezes on MixinBootstrap.init().

By "freezing," I mean that all logs before the init() call are created successfully, but any logs or operations after the init() call are not executed. My agent appears to hang without throwing any error, while Minecraft continues to run as if nothing happened.

Here’s the relevant code snippet:

private void initializeMixins() {
    printer.info("Initializing Mixins");
    try {
        MixinBootstrap.init();
    } catch (Exception e) {
        printer.log(Level.SEVERE, "Failed to initialize Mixins", e);
    }
    printer.info("Mixins initialized");
    Mixins.addConfiguration("mixin.blackstone.json");
    printer.info("Mixins configuration added");
}

In the logs, I can see the line "Initializing Mixins", but after that, there’s no "Mixins initialized", no "Mixins configuration added", and no errors.
My first impression was that it might be a deadlock or something I misconfigured, such as using a wrong method or missing dependency, but I have no clue at the moment.

Additional Details:

  • I'm using the Java Instrumentation API with the -javaagent argument.
  • The program is run from a FAT-JAR containing all dependencies, including Mixin and ASM.
  • Used versions:
    • Mixin: 0.8.3
    • ASM/Util: 9.7

If someone could provide guidance or point out what I might have done wrong, I would greatly appreciate it.

Best regards,
Splatcrafter

@Geolykt
Copy link

Geolykt commented Dec 15, 2024

Might care to use the jstack command to give a threaddump of this deadlock?

Also, Mixin 0.8.3 is rather outdated, you might want to update it.

@Splatcrafter
Copy link
Author

I used jstack to capture a thread dump after encountering the issue where the agent freezes on MixinBootstrap.init(). I also updated Mixin to version 0.8.5, but the behavior remains unchanged.

Below is the full thread dump:
thread-dump.log

From my analysis, Minecraft itself continues running without any issues, but the agent seems to hang during the initialization process. I couldn’t identify any Java-level deadlocks or specific blocked threads, but I might have missed something.

I’d appreciate any further guidance or insights into what might be causing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants