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

Hotspot caught an error that should not have been caught according to the spec

    XMLWordPrintable

Details

    • vm
    • generic
    • generic

    Description

      ADDITIONAL SYSTEM INFORMATION :
      mac os

      openjdk version "1.8.0_352"
      OpenJDK Runtime Environment (Temurin)(build 1.8.0_352-b08)
      OpenJDK 64-Bit Server VM (Temurin)(build 25.352-b08, mixed mode)

      openjdk version "11.0.17" 2022-10-18
      OpenJDK Runtime Environment Temurin-11.0.17+8 (build 11.0.17+8)
      OpenJDK 64-Bit Server VM Temurin-11.0.17+8 (build 11.0.17+8, mixed mode)

      A DESCRIPTION OF THE PROBLEM :
      Hotspot seems to have discrepancies in the implementation of Verifier with the specification, given the attached test case, J9 accepts it normally while hotspot throws a VerifyError.

      We initially submitted it to the J9 developers, and based on their analysis, the hotspot implementation was inconsistent with the spec, more details can be found in: https://github.com/eclipse-openj9/openj9/issues/16524

      We are not sure if this is considered an inadequate consideration of the JVM spec, or if there is a problem with the implementation of hotspot?

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      java -jar lib/asmtools.jar jasm AcceptInvalid01.jasm
      java -cp . AcceptInvalid01

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Accept the class
      ACTUAL -
      Error: Unable to initialize main class AcceptInvalid01
      Caused by: java.lang.VerifyError: Bad type on operand stack in putfield
      Exception Details:
        Location:
          AcceptInvalid01.<init>()V @22: putfield
        Reason:
          Type uninitializedThis (current frame, stack[0]) is not assignable to 'AcceptInvalid01' (constant pool 4)
        Current Frame:
          bci: @22
          flags: { flagThisUninit }
          locals: { uninitializedThis }
          stack: { uninitializedThis, 'java/awt/event/InputMethodEvent' }
        Bytecode:
          0000000: 2abb 0003 5901 c000 0110 9c01 c000 0601
          0000010: c000 06b7 0005 b500 042a b700 02b1

      FREQUENCY : always


      Attachments

        Issue Links

          Activity

            People

              dlsmith Dan Smith
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: