JDK-8256651 : nsk_jvmti_aod_disableEvent{s}AndFinish should pass address of success
  • Type: Bug
  • Component: hotspot
  • Sub-Component: jvmti
  • Affected Version: 16
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2020-11-19
  • Updated: 2024-07-16
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 25
25Unresolved
Related Reports
Relates :  
Description
The change below is not needed as the call to nsk_jvmti_aod_disableEventAndFinish() does exactly the same:

-    nsk_jvmti_aod_disableEventAndFinish(agentName, JVMTI_EVENT_OBJECT_FREE, success, jvmti, jni);
+
+    /* Flush any pending ObjectFree events, which may set success to 1 */
+    if (jvmti->SetEventNotificationMode(JVMTI_DISABLE,
+                                        JVMTI_EVENT_OBJECT_FREE,
+                                        NULL) != JVMTI_ERROR_NONE) {
+        success = 0;
+    }
+
+    nsk_aod_agentFinished(jni, agentName, success);
 }

Posting the event in nsk_jvmti_aod_disableEventAndFinish rather than in the caller beforehand, sets the global 'success' variable and not this local variable so the test would fail.  We should fix these functions so that this code isn't duplicated in one of the tests.  Found when reviewing JDK-8212879.

Then we can undo this part of this patch.