JDK-8373366 : HandshakeState should disallow suspend ops for disabler threads
  • Type: Bug
  • Component: hotspot
  • Sub-Component: jvmti
  • Affected Version: 27
  • Priority: P3
  • Status: In Progress
  • Resolution: Unresolved
  • Submitted: 2025-12-09
  • Updated: 2025-12-12
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 27
27Unresolved
Related Reports
Blocks :  
Description
!!! In construction now  !!!!

HandshakeOperation* HandshakeState::get_op_for_self(bool allow_suspend, bool check_async_exception)

could just skip a HandshakeOperation if the _handshakee->is_vthread_transition_disabler() returns true, so the same suspension temporary disabling mechanism would be used as for _handshakee->is_disable_suspend().

The suggested fix is:

diff --git a/src/hotspot/share/runtime/handshake.cpp b/src/hotspot/share/runtime/handshake.cpp
index 89b02717a7a..360ef45bd07 100644
--- a/src/hotspot/share/runtime/handshake.cpp
+++ b/src/hotspot/share/runtime/handshake.cpp
@@ -521,7 +521,7 @@ HandshakeOperation* HandshakeState::get_op_for_self(bool allow_suspend, bool che
   assert(_lock.owned_by_self(), "Lock must be held");
   assert(allow_suspend || !check_async_exception, "invalid case");
 #if INCLUDE_JVMTI
-  if (allow_suspend && _handshakee->is_disable_suspend()) {
+  if (allow_suspend && (_handshakee->is_disable_suspend() || _handshakee->is_vthread_transition_disabler())) {
     // filter out suspend operations while JavaThread is in disable_suspend mode
     allow_suspend = false;
   }


Comments
A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/28740 Date: 2025-12-10 10:18:11 +0000
10-12-2025