RFR: 8367725: Incorrect reading of oop in SuspendResumeManager::suspend while thread is blocked [v10]

David Holmes dholmes at openjdk.org
Thu Sep 18 05:44:33 UTC 2025


On Thu, 18 Sep 2025 05:07:16 GMT, Leonid Mesnik <lmesnik at openjdk.org> wrote:

>> src/hotspot/share/runtime/suspendResumeManager.cpp line 88:
>> 
>>> 86:   if (register_vthread_SR) {
>>> 87:     assert(_target->is_vthread_mounted(), "sanity check");
>>> 88:     assert(_target == JavaThread::current(), "should be current thread");
>> 
>> So this assert should be outside the INCLUDE_JVMTI section - right?
>
> ough,
> yes, should be outside INCLUDE_JVMTI 
> However, I just can't understand how those methods could be called if JVMTI is not included. Do we still have any mechanisms to suspend thread without jvmti nowdays?

No we don't but we are left with a lot of historical code organization. JVMTI is the only client of the `JavaThread::java_suspend/java_resume` API but that code already existed independent of JVMTI. The current INCLUDE_JVMTI guards are what is needed to make a non-JVMTI configuration build. If we were so inclined we could push those guards right up to JavaThread and then exclude compiling files like `suspendResumeManager.cpp`.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/27317#discussion_r2357574737


More information about the serviceability-dev mailing list