Skip to content

(fix): gate FrameType::isRawPointer on HotSpot - #658

Merged
jbachorik merged 2 commits into
mainfrom
jb/israwpointer-hotspot-gate
Jul 14, 2026
Merged

(fix): gate FrameType::isRawPointer on HotSpot#658
jbachorik merged 2 commits into
mainfrom
jb/israwpointer-hotspot-gate

Conversation

@jbachorik

@jbachorikjbachorik commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?:
Gates FrameType::isRawPointer()'s bit-30 raw-pointer bci encoding to HotSpot only, and fixes frame_ut.cpp to test the hotspot/non-hotspot cases separately now that the check is VM-gated.

Motivation:
The raw-pointer bci encoding (bit 30) only ever means "jmethodID slot replaced by a VMMethod*" on HotSpot. On OpenJ9, an unencoded, VM-supplied bci can coincidentally have bit 30 set, which was misread as our raw-pointer encoding and routed into JVMSupport::resolve(), which asserts/aborts for non-HotSpot VMs. Reproduced on Semeru 8.0.462/OpenJ9 via GetLineNumberTableLeakTest.

Additional Notes:
None.

How to test the change?:
frame_ut.cpp's TrueWhenBit30IsSet test now covers both the HotSpot and non-HotSpot cases explicitly.

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 security review (run the dd:platform-security-review
    skill, or file a request via the PSEC review form).
    bewaire also runs automatically on every PR.
  • This PR doesn't touch any of that.
  • JIRA: PROF-15397 [PROF-15364]

Unsure? Have a question? Request a review!

jbachorikand others added 2 commits July 14, 2026 12:14
The raw-pointer bci encoding (bit 30) only ever means "jmethodID slot
replaced by a VMMethod*" on HotSpot. On OpenJ9, an unencoded, VM-supplied
bci can coincidentally have bit 30 set, which was misread as our
raw-pointer encoding and routed into JVMSupport::resolve(), which
asserts/aborts for non-HotSpot VMs. Reproduced on Semeru 8.0.462/OpenJ9
via GetLineNumberTableLeakTest.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
TrueWhenBit30IsSet assumed isRawPointer() ignores VM kind; split into
hotspot/non-hotspot cases now that it's gated on VM::isHotspot().
@jbachorikjbachorik changed the title Fix: gate FrameType::isRawPointer on HotSpot(fix): gate FrameType::isRawPointer on HotSpotJul 14, 2026
@jbachorik
jbachorik marked this pull request as ready for review July 14, 2026 10:33
@jbachorik
jbachorik requested a review from a team as a code ownerJuly 14, 2026 10:33
@dd-octo-sts

dd-octo-stsBot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

CI Test Results

Run:#29326785663 | Commit:fd9914e | Duration: 17m 13s (longest job)

All 32 test jobs passed

Status Overview

JDKglibc-aarch64/debugglibc-amd64/debugmusl-aarch64/debugmusl-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-07-14 11:11:39 UTC

@dd-octo-sts

Copy link
Copy Markdown
Contributor

Benchmark Results (commit 552da8c)

Pipeline: https://gitlab.ddbuild.io/DataDog/apm-reliability/benchmarking-platform/-/pipelines/124497089 Commit: 552da8c8bbdcbcbc3ff923ba7c13e7540aafe468

⚠️ Significant outliers

  • 🔴 fj-kmeans (JDK 21): runtime +4% (2725→2834 ms)
  • 🔴 future-genetic (JDK 21): runtime +3.4% (2029→2098 ms)
Runtime details (per benchmark × JDK)
BenchmarkJDKLatestDevΔ (dev vs latest)Issues L/D
akka-uct21✅ 10311 ms (21 iters)✅ 10141 ms (21 iters)≈ -1.6% (±10.3%)— / —
finagle-chirper25✅ 5418 ms (36 iters)✅ 5553 ms (35 iters)≈ +2.5% (±24.8%)⚠️ W:3 / ⚠️ W:3
fj-kmeans21✅ 2725 ms (68 iters)✅ 2834 ms (66 iters)🔴 +4%— / —
future-genetic21✅ 2029 ms (91 iters)✅ 2098 ms (88 iters)🔴 +3.4%— / —
future-genetic25✅ 2032 ms (91 iters)✅ 1998 ms (93 iters)≈ -1.7% (±2.8%)— / —
naive-bayes25✅ 1021 ms (168 iters)✅ 1013 ms (168 iters)≈ -0.8% (±31.6%)— / —
reactors21✅ 16371 ms (15 iters)✅ 15634 ms (15 iters)≈ -4.5% (±7.1%)— / —
reactors25✅ 18447 ms (15 iters)✅ 18524 ms (15 iters)≈ +0.4% (±4.4%)— / —
Internal counter details (ddprof)

ddprof internal counters, latest / dev (✅ = 0, · = unavailable):

BenchmarkJDKDropped recDropped jvmtiDropped traceSkipped WCAGCT failUnwind fail
akka-uct21✅ / ✅✅ / ✅3 / 12110 / 1969✅ / ✅✅ / ✅
akka-uct25✅ / ✅✅ / ✅1 / ✅2300 / 2239✅ / ✅✅ / ✅
finagle-chirper25✅ / ✅✅ / ✅1 / ✅8440 / 8369✅ / ✅✅ / ✅
fj-kmeans21✅ / ✅✅ / ✅1 / 21270 / 1248✅ / ✅✅ / ✅
fj-kmeans25✅ / ✅✅ / ✅3 / ✅1253 / ✅✅ / ✅✅ / ✅
future-genetic21✅ / ✅✅ / ✅2 / ✅2949 / 3050✅ / ✅✅ / ✅
future-genetic25✅ / ✅✅ / ✅2 / 12803 / 2935✅ / ✅✅ / ✅
naive-bayes25✅ / ✅✅ / ✅4 / 53471 / 3507✅ / ✅✅ / ✅
reactors21✅ / ✅✅ / ✅2 / ✅1624 / 1635✅ / ✅✅ / ✅
reactors25✅ / ✅✅ / ✅✅ / 31928 / 1862✅ / ✅✅ / ✅

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes an OpenJ9-specific misclassification by making FrameType::isRawPointer() treat bit-30 as the raw-pointer encoding only when running on HotSpot, preventing non-HotSpot BCIs with bit 30 set from being routed into HotSpot-only resolution paths.

Changes:

  • Gate FrameType::isRawPointer(int) on VM::isHotspot() in frame.h.
  • Update frame_ut.cpp to split the previous “bit 30 set” assertion into explicit HotSpot vs non-HotSpot tests (with a test-only accessor to toggle VM::_hotspot).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

FileDescription
ddprof-lib/src/main/cpp/frame.hGates raw-pointer detection on VM::isHotspot() to avoid OpenJ9 false-positives.
ddprof-lib/src/test/cpp/frame_ut.cppAdjusts unit tests to validate both HotSpot and non-HotSpot behavior now that detection is VM-gated.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadddprof-lib/src/test/cpp/frame_ut.cpp
@jbachorik
jbachorik merged commit 94bf8cb into mainJul 14, 2026
187 of 193 checks passed
@jbachorik
jbachorik deleted the jb/israwpointer-hotspot-gate branch July 14, 2026 11:53
@github-actionsgithub-actionsBot added this to the 1.47.0 milestone Jul 14, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@jbachorik