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

Reviewed-by: sspitsyn, lmesnik
  • Loading branch information
plummercj committed Jun 12, 2023
1 parent 45414fc commit 1612b6d
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 @@ -30,7 +30,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/ReferrersTest.java 8285422 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 1612b6d

@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.