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

warning "Re-registering of platform native method: jdk.internal.misc.Unsafe.park(ZJ)V from code in a different classloader" #3054

Open
victornoel opened this issue Feb 28, 2024 · 5 comments

Comments

@victornoel
Copy link

Describe the bug

When Pyroscope agent is loaded at runtime on a Java 21 VM, I can see the following warnings every few seconds in the logs:

[207.865s][warning][jni,resolve] Re-registering of platform native method: jdk.internal.misc.Unsafe.park(ZJ)V from code in a different classloader

To Reproduce

The agent is loaded with:

config =
            new Config.Builder()
                .setApplicationName("MyApp")
                .setProfilingEvent(EventType.ITIMER)
                .setFormat(Format.JFR)
                .setServerAddress(serverAddress)
                .setAllocLive(true)
                .setProfilingAlloc(102400)
                .setProfilingLock(1000000)
                .build();

        PyroscopeAgent.start(
            new PyroscopeAgent.Options.Builder(config)
                .build()
        );

Expected behavior

No warnings

Environment

  • Infrastructure: kubernetes, Java 21, Pyroscope Java Agent 0.13.0
  • Deployment tool: [e.g., helm, jsonnet]

Additional Context

I found this old JDK bug meant to be fixed in Java 15: https://bugs.openjdk.org/browse/JDK-8239593

@maradanasai
Copy link

I was able to get the same issue. All of my logs are filling with this error :/

@korniltsev
Copy link
Collaborator

Does the error happen with the async-profiler https://github.com/async-profiler/async-profiler ?

Please specify exact java versions (including vendor, build number) or base docker image

@victornoel
Copy link
Author

Hi @korniltsev, in my case, it is using Java 21 with the base docker image eclipse-temurin:21-jre-jammy.

I don't remember ever seeing this error when using async-profiler, but it's hard to know as I mostly used it on my local machine (no docker). I will try to find some time to test it out, but I have to admit I can't guarantee I will be able to do it soon :P

@victornoel
Copy link
Author

Hi @korniltsev, today I tested running some java in the exact same setup as when using pyroscope but without pyroscope and only async-profiler v3.0 added as an agent to the VM arguments and there are no warnings.

Since pyroscope loads the agent at runtime, maybe this is where the difference is… also I'm not sure if pyroscope uses the latest version of async-profiler (3.0)? this could also be an explanation…

@gabrieldimech
Copy link

we are experiencing the same issue with eclipse-temurin:21.0.2_13-jdk and agent v0.14.0

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

4 participants