From 8de3c0df60eec75c14bc4a06df328e059a13a3f9 Mon Sep 17 00:00:00 2001 From: Zhengyu Gu Date: Tue, 7 Apr 2026 20:01:44 +0000 Subject: [PATCH] Fix VMMethod::validatedId() crash --- ddprof-lib/src/main/cpp/hotspot/vmStructs.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ddprof-lib/src/main/cpp/hotspot/vmStructs.cpp b/ddprof-lib/src/main/cpp/hotspot/vmStructs.cpp index 3a3c4c27b..181097e47 100644 --- a/ddprof-lib/src/main/cpp/hotspot/vmStructs.cpp +++ b/ddprof-lib/src/main/cpp/hotspot/vmStructs.cpp @@ -733,7 +733,8 @@ jmethodID VMMethod::id() { jmethodID VMMethod::validatedId() { jmethodID method_id = id(); - if (!_can_dereference_jmethod_id || (goodPtr(method_id) && *(VMMethod**)method_id == this)) { + if (!_can_dereference_jmethod_id || + ((goodPtr(method_id) && SafeAccess::loadPtr((void**)method_id, nullptr) == this))) { return method_id; } return NULL;