byte-buddy icon indicating copy to clipboard operation
byte-buddy copied to clipboard

AgentBuilder.LambdaInstrumentationStrategy.ENABLED crashes minecraft server

Open marlester-dev opened this issue 2 years ago • 1 comments

    public static AgentBuilder createAgentBuilder() {
        return new AgentBuilder.Default()
                .with(AgentBuilder.RedefinitionStrategy.RETRANSFORMATION);
    }

works, but

    public static AgentBuilder createAgentBuilder() {
        return new AgentBuilder.Default()
                .with(AgentBuilder.RedefinitionStrategy.RETRANSFORMATION)
                .with(AgentBuilder.LambdaInstrumentationStrategy.ENABLED);
    }

doesn't. my creation logic is

        ByteBuddyHelper.createAgentBuilder()
                .with(AgentBuilder.Listener.StreamWriting.toSystemError())
                .type(ElementMatchers.is(clazz))
                .transform((builder, typeDescription, classLoader, module, protectionDomain) -> builder
                        .visit(
                                Advice.withCustomMapping().bind(PluginName.class, pluginname)
                                        .to(MethodAdvice.class).on(ElementMatchers.named("j").and(ElementMatchers.takesArguments(argclass)))
                        )
                )
                .installOn(ByteBuddyHelper.AGENT);

Server crashes gradually with systems going out step by step, log is too big.

marlester-dev avatar Aug 11 '23 18:08 marlester-dev

Lambda instrumentation is fairly experimental and I recommend against using it unless using a controlled JVM version that is proven to work with a specific setup.

Is there a crash dump? And what JVM and version ate you using?

raphw avatar Aug 12 '23 17:08 raphw