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

Segfault in ClassListParser::resolve_indy dumping static AppCDS archive

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 16
    • Fix Version/s: 16
    • Component/s: hotspot
    • Subcomponent:
    • Resolved In Build:
      b29

      Backports

        Description

        Gunnar Morling reports this regression in JDK 16:

        #
        # A fatal error has been detected by the Java Runtime Environment:
        #
        # SIGSEGV (0xb) at pc=0x0000000109cdcc9c, pid=6375, tid=7427
        #
        # JRE version: OpenJDK Runtime Environment (16.0+27) (build 16-ea+27-1884)
        # Java VM: OpenJDK 64-Bit Server VM (16-ea+27-1884, interpreted mode, tiered, compressed oops, g1 gc, bsd-amd64)
        # Problematic frame:
        # V [libjvm.dylib+0x2dcc9c] ClassListParser::resolve_indy(Symbol*, Thread*)+0xcc
        #

        https://github.com/gunnarmorling/quarkus-cds#reproducer-for-seg-fault-with-jdk-16

        ---

        git clone https://github.com/gunnarmorling/quarkus-cds.git
        cd quarkus-cds/quarkus-cds
        export JAVA_HOME=<recent JDK 16>
        export PATH=$JAVA_HOME/bin:$PATH
        mvn clean verify -DskipTests=true -DskipITs=true

        java --version
        openjdk 16-ea 2021-03-16
        OpenJDK Runtime Environment (build 16-ea+27-1884)
        OpenJDK 64-Bit Server VM (build 16-ea+27-1884, mixed mode, sharing)

        Create the runtime image:

        $JAVA_HOME/bin/jlink --add-modules java.base,java.compiler,java.instrument,java.naming,java.rmi,java.security.jgss,java.security.sasl,java.sql,jdk.jconsole,jdk.unsupported \
          --output target/runtime-image

        mkdir target/runtime-image/cds

        Create the class list file:

        ./target/runtime-image/bin/java -XX:DumpLoadedClassList=target/todo-manager-classlist.lst \
          -jar target/todo-manager-1.0.0-SNAPSHOT-runner.jar

        The above command starts a quarkus command. Let it run through initialization, then terminate it (Ctrl + C)

        Observe the seg fault when running the following:

        ./target/runtime-image/bin/java -Xshare:dump \
          -XX:SharedClassListFile=target/todo-manager-classlist.lst \
          -XX:SharedArchiveFile=target/runtime-image/cds/app-cds.jsa \
          -jar target/todo-manager-1.0.0-SNAPSHOT-runner.jar

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                ccheung Calvin Cheung
                Reporter:
                redestad Claes Redestad
                Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: