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

SPECjvm2008/xml.transform with CDS fails with "can't seal package nu.xom"

    XMLWordPrintable

Details

    • b12

    Backports

      Description

        Run SPECjvm2008 with the following parameters

        java \
            --add-exports=java.xml/com.sun.org.apache.xerces.internal.parsers=ALL-UNNAMED \
            --add-exports=java.xml/com.sun.org.apache.xerces.internal.util=ALL-UNNAMED \
            -Xms3g -Xmx3g -Xlog:gc \
            -jar SPECjvm2008/SPECjvm2008.jar xml.transform \
            -ikv -fit 1 -wt 0 -i 1 -bt 1

        If we change the above command to dump the classlist, create a CDS archive, and run with the CDS archive, the following exception is displayed:
        =====
          Benchmark: xml.transform
          Run mode: timed run
          Test type: multi
          Threads: 1
          Iterations: 40
          Run length: 1s
        xom canonicalization of chess-fo/Kasparov-Karpov.xml.SAX crashed.
        ===

        If we change the classlist to have only a single line with the class "nu.xom.Node", dump the archive and run the app again, the following exception stack is printed:

        =====
        Error in setup of Benchmark.
        spec.harness.StopBenchmarkException: Error invoking bmSetupBenchmarkMethod
        at spec.harness.ProgramRunner.invokeBmSetupBenchmark(ProgramRunner.java:185)
        at spec.harness.ProgramRunner.runBenchmark(ProgramRunner.java:301)
        at spec.harness.ProgramRunner.run(ProgramRunner.java:98)
        Caused by: java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:118)
        at java.base/java.lang.reflect.Method.invoke(Method.java:580)
        at spec.harness.ProgramRunner.invokeBmSetupBenchmark(ProgramRunner.java:183)
        ... 2 more
        Caused by: java.lang.SecurityException: sealing violation: can't seal package nu.xom: already defined
        at java.base/jdk.internal.loader.BuiltinClassLoader.getAndVerifyPackage(BuiltinClassLoader.java:912)
        at java.base/jdk.internal.loader.BuiltinClassLoader.defineOrCheckPackage(BuiltinClassLoader.java:877)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.defineOrCheckPackage(ClassLoaders.java:211)
        at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:849)
        at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:760)
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:681)
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:639)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
        at spec.benchmarks.xml.transform.Main.<init>(Main.java:197)
        at spec.benchmarks.xml.transform.Main.setupBenchmark(Main.java:152)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
        ... 4 more
        ==========

        Attachments

          Issue Links

            Activity

              People

                ccheung Calvin Cheung
                iklam Ioi Lam
                Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: