Skip to content

Commit

Permalink
8309752: com/sun/jdi/SetLocalWhileThreadInNative.java fails with virt…
Browse files Browse the repository at this point in the history
…ual test thread factory due to OpaqueFrameException

Backport-of: 1612b6dc6e7075e1c0c82d0e92910051c8066fe5
  • Loading branch information
GoeLin committed Apr 1, 2024
1 parent 6791646 commit 245de59
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
1 change: 0 additions & 1 deletion test/jdk/ProblemList-Virtual.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ com/sun/jdi/EATests.java#id0 8264699 generic-

com/sun/jdi/ExceptionEvents.java 8278470 generic-all
com/sun/jdi/RedefineCrossStart.java 8278470 generic-all
com/sun/jdi/SetLocalWhileThreadInNative.java 8285422 generic-all
com/sun/jdi/cds/CDSBreakpointTest.java 8307778 generic-all
com/sun/jdi/cds/CDSDeleteAllBkptsTest.java 8307778 generic-all
com/sun/jdi/cds/CDSFieldWatchpoints.java 8307778 generic-all
Expand Down
13 changes: 10 additions & 3 deletions test/jdk/com/sun/jdi/SetLocalWhileThreadInNative.java
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,20 @@ protected void runTests()
Asserts.assertEQ(frame.location().method().toString(), "SetLocalWhileThreadInNativeTarget.dontinline_testMethod()");
List<LocalVariable> localVars = frame.visibleVariables();
boolean changedLocal = false;
boolean caughtOFE = false;
for (LocalVariable lv : localVars) {
if (lv.name().equals("zero")) {
frame.setValue(lv, vm().mirrorOf(0)); // triggers deoptimization!
changedLocal = true;
try {
frame.setValue(lv, vm().mirrorOf(0)); // triggers deoptimization!
changedLocal = true;
} catch (OpaqueFrameException e) {
caughtOFE = true;
}
}
}
Asserts.assertTrue(changedLocal);
boolean isVirtualThread = "Virtual".equals(System.getProperty("main.wrapper"));
Asserts.assertTrue(caughtOFE == isVirtualThread);
Asserts.assertTrue(changedLocal == !isVirtualThread);

// signal stop
os.write(STOP);
Expand Down

1 comment on commit 245de59

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.