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

Second execution of an invokedynamic throws NoClassDefFoundError if its bootstrap throws a user-defined LinkageError

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 8, 9, 11, 17, 21, 25
    • hotspot

      if the bootstrap method of an invokedynamic throws an instance of a user-defined LinkageError subclass, the following happens:
      * `java.lang.invoke.CallSite#makeSite` lets that through directly (it doesn't wrap `java.lang.Error` instances)
      * since it's an instance of LinkageError, it gets saved as a resolution error in the constant pool & resolution error table
      * it's then rethrown at the invokedynamic that triggered this resolution
      * the next time this invokedynamic is executed, the VM tries to throw the saved resolution error
      * it tries to locate the exception type in the boot class loader but fails. leading to a NoClassDefFoundError

      According to JVMS § 5.4.3:
      > Subsequent attempts by the same instruction in the class file to resolve the symbolic reference always fail with the same error that was thrown as a result of the initial resolution attempt.

            dholmes David Holmes
            gdub Gilles Duboscq
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: