Skip to content

Agent incorrectly assumes that JVM version == JDK version #136

Closed

Description

@asm0dey

We at BellSoft have JDK 8 with underlying JVM 17. If I run my Java8 application on my JDK with DataDog agent, I get a crash like this one

In reality, it's possible (and correct) to check the JVM version, not JDK. For example, the property java.vm.version contains 17.0.9+10-LTS in our case.

It seems to be related to these lines:

if (VM::java_version() >= 15 && !VM::isOpenJ9()) {

Activity

  1. jbachorik commented on Oct 11, 2024

    @jbachorik
    Collaborator

    Aargh ...
    Would it possible to find something distinctive? Java 8 will put 25.* into that system property. While we could hard-code '25 == 8', once we get proper JDK 25, this will get incredibly messy.

    I just want to make sure what would be the right cause of action - currently, we are reading java.vm.version to retrieve the JVM version. But it does return value 17, since you are running JVM 17 there. But the version returned by java.runtime.version would be '8.*' I assume, correct? And the code that is crashing is actually using the JDK functionality and as such we would have to have two versions - vm and jdk, right? And then check all occasions where we guard some functionality based on the Java version and decide whether it is JVM or JDK related.

  2. asm0dey commented on Oct 11, 2024

    @asm0dey
    Author

    @jbachorik sorry for causing chaos! There are many questions here; I have only some answers and can grab more. If it will help I can privately send you a build of our JDK for you to check everything you need

  3. jbachorik commented on Oct 11, 2024

    @jbachorik
    Collaborator

    If it will help I can privately send you a build of our JDK for you to check everything you need

    yes, this would be very helpful

  4. dpochepk commented on Oct 11, 2024

    @dpochepk

    Aargh ... Would it possible to find something distinctive? Java 8 will put 25.* into that system property. While we could hard-code '25 == 8', once we get proper JDK 25, this will get incredibly messy.

    I just want to make sure what would be the right cause of action - currently, we are reading java.vm.version to retrieve the JVM version. But it does return value 17, since you are running JVM 17 there. But the version returned by java.runtime.version would be '8.*' I assume, correct? And the code that is crashing is actually using the JDK functionality and as such we would have to have two versions - vm and jdk, right? And then check all occasions where we guard some functionality based on the Java version and decide whether it is JVM or JDK related.

    Yes. You're correct. java.runtime.version still has something like "1.8.0_*".

  5. asm0dey commented on Oct 12, 2024

    @asm0dey
    Author

    @jbachorik I've sent a mail to your address I found here on GH, could you please answer when you have a minute?

  6. jbachorik commented on Oct 29, 2024

    @jbachorik
    Collaborator

    Fixed in #142

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions