JDK-8307362 : Remove test com/sun/jdi/JdbLastErrorTest.java
  • Type: Bug
  • Component: core-svc
  • Sub-Component: debugger
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2023-05-03
  • Updated: 2023-05-11
  • Resolved: 2023-05-04
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 21
21 b22Fixed
Related Reports
Duplicate :  
Description
JdbLastErrorTest.java tests use of SetLastError and GetLastError using Panama (on Windows).  It is unreliable.

The updated Panama situation is that this test as written will still fail sometimes, but that is because the test is doing it wrong. An actual call to the native GetLastError can still overwrite the last error value: making a new call is likely to break the last error value just doing method resolution, at least the first time it happens.

But the answer to the original problem is that we now have Linker.Option.CaptureCallState which gives us the chance to capture last error when calling a MethodHandle, and read the stored last error code in a VarHandle.

The test should be removed, it is redundant.  Calling set/get last error directly is not the way to do this, and CaptureCallState is tested in test/jdk/java/foreign/capturecallstate/TestCaptureCallState.java

Comments
Changeset: e206d57b Author: Kevin Walls <kevinw@openjdk.org> Date: 2023-05-04 06:31:15 +0000 URL: https://git.openjdk.org/jdk/commit/e206d57bfc09032e17d09714fc54ab2f5e961792
04-05-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/13781 Date: 2023-05-03 14:18:00 +0000
03-05-2023