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

vm crash on ImageNativeSubstrate.JIMAGE_PackageToModule call with null as package name

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • Introduced In Version:
      9
    • CPU:
      x86_64
    • OS:
      linux

      Description

      Code:

      $ cat NullPackage.java
      import jdk.internal.jimage.ImageNativeSubstrate;

      public class NullPackage {

          static String imageFile = System.getProperty("java.home") + "/lib/modules/bootmodules.jimage";

          public static void main(String... args) throws Exception {
              long jimageHandle = ImageNativeSubstrate.JIMAGE_Open(imageFile);

              String modName = ImageNativeSubstrate.JIMAGE_PackageToModule(jimageHandle, null);
              ImageNativeSubstrate.JIMAGE_Close(jimageHandle);
          }
      }

      Java version:

      $ javac -version
      javac 1.9.0-internal

      Actual result:

      $ javac NullPackage.java
      $ java NullPackage
      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # SIGSEGV (0xb) at pc=0x00007f78d19bee14, pid=6527, tid=6528
      #
      # JRE version: OpenJDK Runtime Environment (9.0) (build 1.9.0-internal-sep_2015_10_27_03_42-b00)
      # Java VM: OpenJDK 64-Bit Server VM (1.9.0-internal-sep_2015_10_27_03_42-b00, mixed mode, tiered, compressed oops, g1 gc, linux-amd64)
      # Problematic frame:
      # V [libjvm.so+0x6c0e14] jni_GetStringUTFChars+0x74
      #
      # Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport %p %s %c %P" (or dumping to /home/sep/Stuff/Java/myBugs/jimage/core.6527)
      #
      # An error report file with more information is saved as:
      # /home/sep/Stuff/Java/myBugs/jimage/hs_err_pid6527.log
      #
      # If you would like to submit a bug report, please visit:
      # http://bugreport.java.com/bugreport/crash.jsp
      #
      Aborted (core dumped)

      Expected result:

      ImageNativeSubstrate.JIMAGE_PackageToModule to return null as for non-existing package

        Attachments

          Activity

            People

            • Assignee:
              jlaskey Jim Laskey
              Reporter:
              spikalev Sergei Pikalev (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: