Skip to content

Do not perform deep validity check of jmethodid on JDK 26+#428

Merged
jbachorik merged 1 commit intomainfrom
jb/jmethodid_26
Mar 22, 2026
Merged

Do not perform deep validity check of jmethodid on JDK 26+#428
jbachorik merged 1 commit intomainfrom
jb/jmethodid_26

Conversation

@jbachorik
Copy link
Copy Markdown
Collaborator

@jbachorik jbachorik commented Mar 20, 2026

What does this PR do?:
Fix completely dysfunctional Java frame symbolication on Java 26

Motivation:
https://bugs.openjdk.org/browse/JDK-8268406 changed how jmethodid was represented in Hotspot JVMs.
Although the original fix for this was provided with async-profiler, another, sneakier issue remained in DD Java profiler - we perform deep validation of jmethodid to avoid surprising crashes due to attempts to access an invalid memory.
However, this validation is completely wrong on JDK 26 and later because jmethodids are now just a monotonically increasing key to a side table and we can not really validate anything.

Additional Notes:

How to test the change?:
Run a test load, capture profile and check the stacktraces. There should be no 'jvmtiError' frames.

For Datadog employees:

  • If this PR touches code that signs or publishes builds or packages, or handles
    credentials of any kind, I've requested a review from @DataDog/security-design-and-guidance.
  • This PR doesn't touch any of that.
  • JIRA: PROF-14087

Unsure? Have a question? Request a review!

@jbachorik jbachorik requested a review from a team as a code owner March 20, 2026 20:39
@jbachorik jbachorik requested a review from zhengyu123 March 20, 2026 20:39
@dd-octo-sts
Copy link
Copy Markdown

dd-octo-sts bot commented Mar 20, 2026

CI Test Results

Run: #23361687570 | Commit: 4a6bff8 | Duration: 10m 21s (longest job)

All 32 test jobs passed

Status Overview

JDK glibc-aarch64/debug glibc-amd64/debug musl-aarch64/debug musl-amd64/debug
8 - - -
8-ibm - - -
8-j9 - -
8-librca - -
8-orcl - - -
11 - - -
11-j9 - -
11-librca - -
17 - -
17-graal - -
17-j9 - -
17-librca - -
21 - -
21-graal - -
21-librca - -
25 - -
25-graal - -
25-librca - -

Legend: ✅ passed | ❌ failed | ⚪ skipped | 🚫 cancelled

Summary: Total: 32 | Passed: 32 | Failed: 0


Updated: 2026-03-20 20:53:34 UTC

@jbachorik jbachorik requested review from kaahos and rkennke March 21, 2026 08:48
Copy link
Copy Markdown
Contributor

@zhengyu123 zhengyu123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jbachorik jbachorik merged commit 416d62c into main Mar 22, 2026
85 checks passed
@jbachorik jbachorik deleted the jb/jmethodid_26 branch March 22, 2026 17:07
@github-actions github-actions bot added this to the 1.40.0 milestone Mar 22, 2026
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

Successfully merging this pull request may close these issues.

2 participants