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

Error verifying java.lang.Error causes VM to exit silently due to stack overflow

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 6
    • 6
    • hotspot
    • b84
    • generic
    • generic

      One of the profiler vendors reports that the fastdebug build exits without error message when run with their agent (that does BCI) and -Xverify:all.

      I attach a Windows DLL that is the agent and the problem duplicates with:

      C:\> java -version
      java version "1.6.0-beta2-fastdebug"
      Java(TM) SE Runtime Environment (build 1.6.0-beta2-fastdebug-b76)
      Java HotSpot(TM) Client VM (build 1.6.0-debug, mixed mode)

      C:\> java -agentpath:yjpagent.dll=port=10000 -Xverify:all -version
      [YourKit Java Profiler 6.0 EAP build 904] Using JVMTI

      The VM just exits without any error message!

      The agent is doing BCI and it appears that it doesn't update the LocalVariableTable attribute correctly. This leads to a verification error when verifying the no-arg constructor of java.lang.Error. In one of the entries it looks like start_pc+length is in range but it isn't an index of an opcode which causes a ClassFormatError to be thrown.

      Further insight is obtained when running with +TraceClassInitialization:

      C:\> java -agentpath:yjpagent.dll=port=10000 -Xverify:all -XX:+TraceClassInitialization -version
      Start class verification for: java.lang.ref.Reference
      VM option '+TraceClassInitialization'
      Start class verification for: java.io.Serializable
      End class verification for: java.io.Serializable
      Start class verification for: java.lang.Error
      Start class verification for: java.lang.Error
      Start class verification for: java.lang.Error
      :
      :
      Start class verification for: java.lang.Error
      Start class verification for: java.lang.Error
      Start class verification for: java.lang.Error

      which suggests that throwing ClassFormatError (an Error) leads to a recursive attempts to verify java.lang.Error and finally a "silent" stack overflow.

            kamg Keith Mcguigan (Inactive)
            alanb Alan Bateman
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: