Skip to content

Commit 95a3498

Browse files
jbachorikclaude
andcommitted
Fix: gate FrameType::isRawPointer on HotSpot
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>
1 parent 60f1f83 commit 95a3498

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

ddprof-lib/src/main/cpp/frame.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,11 @@ class FrameType {
7979
return (FrameTypeId)((bci >> TYPE_SHIFT) & FRAME_TYPE_MASK);
8080
}
8181

82+
// Raw pointers only exist on HotSpot (see hotspotSupport.cpp fillFrameRaw).
83+
// On other VMs an unencoded, VM-supplied bci can coincidentally have bit 30
84+
// set; that must not be mistaken for our raw-pointer encoding.
8285
static inline bool isRawPointer(int bci) {
83-
return bci > 0 && (bci & RAW_POINTER_MASK) != 0;
86+
return VM::isHotspot() && bci > 0 && (bci & RAW_POINTER_MASK) != 0;
8487
}
8588
};
8689

0 commit comments

Comments
 (0)