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

Redefinition doesn't but should verify the new klass

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 24
    • None
    • hotspot
    • master


      Redefinition calls the verifier passing true for should_verify_class.

            RedefineVerifyMark rvm(the_class, scratch_class, state);
            Verifier::verify(scratch_class, true, THREAD);

      But code within the verifier decides otherwise if the class belongs to the null class loader. verify() calls

          Verifier::is_eligible_for_verification(InstanceKlass* klass, bool should_verify_class) {

      which calls

          bool Verifier::should_verify_for(oop class_loader, bool should_verify_class) {
            return (class_loader == nullptr || !should_verify_class) ?
              BytecodeVerificationLocal : BytecodeVerificationRemote;
          }

      So returns false for redefining java.lang.VerifyError for example. Should that code be an && above ?

      is_eligible_for_verification also has some exceptions, that for redefinition (java.lang.Class etc) should not be exceptions. They should be verified if redefined.

      -Xverify:all sets BytecodeVerificationLocal to true, but that's not what's needed for redefinition. There should be a way to call the verifier with an always verify flag.

            coleenp Coleen Phillimore
            coleenp Coleen Phillimore
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: