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.
- relates to
-
JDK-8341094 Clean up relax_verify in ClassFileParser
- Resolved
- links to
-
Commit(master) openjdk/jdk/8f22db23
-
Review(master) openjdk/jdk/22116