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

Crash in runtime image built with jlink --compress=2

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      team
    • CPU:
      x86
    • OS:
      windows

      Backports

        Description

        If one creates a Zip-compressed runtime image using jlink, java always crashes.

        Steps to reproduce:
        1. Create a runtime image:
        images/jdk> bin/jlink --compress=2 --add-modules=java.base --output jrebase

        2. Run java -version from the image:
        images/jdk> jrebase/bin/java -version
        Execution protection violation
        #
        # A fatal error has been detected by the Java Runtime Environment:
        #
        # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000043d, pid=14308, tid=23724
        #
        # JRE version: (12.0+99) (build )
        # Java VM: Java HotSpot(TM) Server VM (12-sustaining+99, mixed mode, emulated-client, g1 gc, windows-x86)
        # Problematic frame:
        # C 0x0000043d
        #
        # No core dump will be written. Minidumps are not enabled by default on client versions of Windows
        #
        # An error report file with more information is saved as:
        # C:\ade\work\jdk-dev\build\windows-x86-server-release\images\jdk\hs_err_pid14308.log
        #
        # If you would like to submit a bug report, please visit:
        # http://bugreport.java.com/bugreport/crash.jsp
        #


        jimage.dll looks up ZIP_InflateFully [1][2] function from zip.dll dynamically. JDK-8201226 removed JNICALL (__stdcall) modifier from ZIP_InflateFully [3][4] to overcome __stdcall name mangling on Win32.

        It stopped working since JDK-8200178 which removed /export options to the linker [5] because the mangled name was exported. Therefore the function ZIP_InflateFully would not be found.


        When using --compress={0,1}, the resulting image does not crash.

        [1] http://hg.openjdk.java.net/jdk/jdk/file/f94c7929a44b/src/java.base/share/native/libjimage/imageDecompressor.cpp#l41
        [2] http://hg.openjdk.java.net/jdk/jdk/file/f94c7929a44b/src/java.base/share/native/libjimage/imageDecompressor.cpp#l85
        [3] http://hg.openjdk.java.net/jdk/jdk/rev/e0af66d6e968#l6.63
        [4] http://hg.openjdk.java.net/jdk/jdk/rev/e0af66d6e968#l7.43
        [5] http://hg.openjdk.java.net/jdk/jdk/rev/396ea30afbd5#l2.97

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  aivanov Alexey Ivanov
                  Reporter:
                  aivanov Alexey Ivanov
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: