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

Runtime crashes with access violation during JNI_CreateJavaVM call

    XMLWordPrintable

Details

    • b09
    • x86_64
    • windows_10

    Description

      ADDITIONAL SYSTEM INFORMATION :
      This started to appear with Java 15.0 and is still present in Java 17.0.1. We have only tested on Windows 10 (20H2, 21H1, 21H2) but it may be present in Windows 8.1 and 11 too. It happens with the Temurin and Corretto runtimes as well as the Oracle runtime. Everything works fine on macOS using the 17.0.1 runtime.

      A DESCRIPTION OF THE PROBLEM :
      Finale is a C++ music notation application that uses a Java runtime for its MusicXML functionality. The JNI_CreateJavaVM call from the JNI Invocation API creating the runtime works through Java 14.0.2 on Windows. But it crashes the app with a fatal error access violation starting in Java 15.0 and continuing through 17.0.1.

      REGRESSION : Last worked in version 14

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1) Build a custom Java 17 runtime

      - On a Windows development machine or VM, download the 17.0.1 JDK MSI installer from https://www.oracle.com/java/technologies/downloads/#jdk17-windows
      - Install the Java 17 JDK
      - In the command prompt, cd to the bin folder of the JDK, typically "C:\Program Files\Java\jdk-17.0.1\bin"
      - Build a new Java 17 Windows runtime using

      jlink --output jre --no-header-files --no-man-pages --strip-debug --strip-native-commands --compress=2 --add-modules java.base,java.desktop,java.prefs,java.xml

      Use whatever output folder is convenient, but make sure the final folder name is jre.

      - Save the jre folder away for later use if creating this on a VM.

      2) Install Finale 27.1 (which includes a Java 11 runtime) on a clean Windows system.

      - Go to https://www.finalemusic.com/free-trial/
      - Click on Windows
      - Log into your MakeMusic account, or create a free account if you do not have one
      - FinaleDemoSetup.exe will download automatically
      - Create a clean Windows VM using VMware Fusion 12.2 with 2 processor cores and 4GB memory running Windows 10 Pro 21H2.
      - Run the FinaleDemoSetup installer with the default choices, accepting the license agreement and not displaying the readme. Restart the VM if asked.

      3) Run Finale 27.1 to ensure that Java 11 is launching correctly.

      - Launch Finale from the desktop. Click "Remind Me Later" in the Authorize Finale dialog. You will be able to reproduce this issue even after the 30-day trial expires.
      - Click on Import MusicXML on the Finale launch window. This will create the Java 11 runtime using the JNI Invocation API.
      - You should see a file selection dialog appear.
      - Cancel out of the file selection dialog and exit Finale (File > Exit).

      4) Replace the Java 11 runtime with an identically built Java 17 runtime

      - In the File Explorer, go to the place where the embedded Java runtime is installed. This is typically "C:\Program Files\MakeMusic\Finale\27\Plugin Components\Java".
      - Delete the jre folder.
      - Copy the jre folder that you created with Java 17 into the Java folder. What this does is replace Finale's Java 11 runtime with an identically built Java 17 runtime.

      5) Run Finale 27.1 with the Java 17 runtime.
       
      - Start Finale again
      - Click "Remind Me Later" in the Authorize Finale dialog.
      - Click on Import MusicXML in the Finale launch window.


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The Finale file selection dialog should appear with the Java 17 runtime as it does with the Java 11 runtime.
      ACTUAL -
      Finale crashes due to a Java Runtime Environment error and an error log is produced on the desktop.

      CUSTOMER SUBMITTED WORKAROUND :
      Our workaround is to stay on Java 11. We have not found a workaround that works with Java 17.0.1.

      FREQUENCY : always


      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              14 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: