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

Native default Interface method yields assertion with -noverify

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P2
    • Resolution: Not an Issue
    • Affects Version/s: hs25
    • Fix Version/s: hs25
    • Component/s: hotspot
    • Labels:

      Description

      Latest JDK 8 hotspot-rt sources demonstrates issue with native default interface method when -noverify is specified. This yielded expected results in JDK 8 b117.

      % $JAVA_HOME/bin/java -d64 -server vm.runtime.defmeth.AccessibilityFlagsTest -filter testNativeMethod

      AccessibilityFlagsTest {ver=52; flags=0; redefine=false; execMode=}
      AccessibilityFlagsTest.testNativeMethodAbstract
          DIRECT:
              Test1_Class__forName : PASSED
              Test1_Class__forName : PASSED
              Test1_Class__forName : PASSED
              Test1_Class__forName : PASSED
              Test1_Class__forName : PASSED
      AccessibilityFlagsTest.testNativeMethodDefault
          DIRECT:
              Test1_Class__forName : PASSED
              Test1_Class__forName : PASSED
              Test1_Class__forName : PASSED
      TEST PASSED

      % $JAVA_HOME/bin/java -d64 -server -noverify vm.runtime.defmeth.AccessibilityFlagsTest -filter testNativeMethod

      AccessibilityFlagsTest {ver=52; flags=0; redefine=false; execMode=}
      AccessibilityFlagsTest.testNativeMethodAbstract
          DIRECT:
      # To suppress the following error report, specify this argument
      # after -XX: or in .hotspotrc: SuppressErrorAt=/method.cpp:68
      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # Internal Error (/java/east/u1/lfoltan/hpot/wrk_hpot-rt/src/share/vm/oops/method.cpp:68), pid=14668, tid=139978776061696
      # assert(!access_flags.is_native() || byte_code_size == 0) failed: native methods should not contain byte codes
      #
      # JRE version: Java(TM) SE Runtime Environment (8.0-b117) (build 1.8.0-ea-b117)
      # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.0-b61-wrk_hpot-rt_1125_1154-fastdebug mixed mode linux-amd64 compressed oops)
      # Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
      #
      # An error report file with more information is saved as:
      # /java/east/u1/lfoltan/lambda/wrk_defmeth/hs_err_pid14668.log
      #
      # If you would like to submit a bug report, please visit:
      # http://bugreport.sun.com/bugreport/crash.jsp
      #
      Current thread is 139978776061696
      Dumping core ...
      Abort (core dumped)

      With JDK 8 b117 promoted, the test yielded expected results with -noverify:

      % $JAVA_B117/bin/java -version
      java version "1.8.0-ea"
      Java(TM) SE Runtime Environment (build 1.8.0-ea-b117)
      Java HotSpot(TM) 64-Bit Server VM (build 25.0-b59, mixed mode)

      $JAVA_B117/bin/java -d64 -server -noverify vm.runtime.defmeth.AccessibilityFlagsTest -filter testNativeMethod

      AccessibilityFlagsTest {ver=52; flags=0; redefine=false; execMode=}
      AccessibilityFlagsTest.testNativeMethodAbstract
          DIRECT:
              Test1_Class__forName : FAILED
                      Expected exception java.lang.ClassFormatError, got: class nsk.share.TestFailure: No exception was thrown
      AccessibilityFlagsTest.testNativeMethodDefault
          DIRECT:
              Test1_Class__forName : FAILED
                      Expected exception java.lang.ClassFormatError, got: class nsk.share.TestFailure: No exception was thrown
      TEST FAILED

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                lfoltan Lois Foltan
                Reporter:
                lfoltan Lois Foltan
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: