JDK-8345127 : Add --sun-misc-unsafe-memory-access=allow when running tests until JDK-8334137 is fixed
  • Type: Bug
  • Component: javafx
  • Sub-Component: other
  • Affected Version: jfx24
  • Priority: P3
  • Status: In Progress
  • Resolution: Unresolved
  • Submitted: 2024-11-27
  • Updated: 2024-12-13
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.
Other
jfx24Unresolved
Related Reports
Relates :  
Relates :  
Description
JEP 498 [0] prints a warning on use of any memory-access methods in sun.misc.Unsafe in JDK 24. When running JavaFX applications or test programs with JDK 24, we now get warnings that we are using a terminally deprecated method of sun.misc.Unsafe as follows:

WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
WARNING: sun.misc.Unsafe::allocateMemory has been called by com.sun.marlin.OffHeapArray (file:.../build/shims/javafx.graphics/)
WARNING: Please consider reporting this to the maintainers of class com.sun.marlin.OffHeapArray
WARNING: sun.misc.Unsafe::allocateMemory will be removed in a future release

Eliminating the use of sun.misc.Unsafe memory access methods by Marlin is being tracked by JDK-8334137 (see also JDK-8345121). As a workaround, until JDK-8334137 is fixed, we need to pass the following flag when running tests:

--sun-misc-unsafe-memory-access=allow

This flag is only recognized on JDK 23 and later, so we will qualify passing this flag based on the version of the JDK used to run the tests. 

[0] https://openjdk.org/jeps/498

Comments
A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jfx/pull/1650 Date: 2024-11-27 19:27:55 +0000
13-12-2024