Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8345127

Add --sun-misc-unsafe-memory-access=allow when running tests until JDK-8334137 is fixed

XMLWordPrintable

    • b22

      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

            kcr Kevin Rushforth
            kcr Kevin Rushforth
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: