8376295: "assert(BytecodeVerificationRemote) failed: Should not be here" when running class redefinition test with -XX:-BytecodeVerificationRemote

Reviewed-by: dholmes, coleenp, sspitsyn
This commit is contained in:
Leonid Mesnik 2026-02-24 19:41:31 +00:00
parent 4673781523
commit 9f89fa5b67
2 changed files with 10 additions and 6 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2026, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -620,9 +620,6 @@ TypeOrigin ClassVerifier::ref_ctx(const char* sig) {
void ClassVerifier::verify_class(TRAPS) {
log_info(verification)("Verifying class %s with new format", _klass->external_name());
// Either verifying both local and remote classes or just remote classes.
assert(BytecodeVerificationRemote, "Should not be here");
Array<Method*>* methods = _klass->methods();
int num_methods = methods->length();

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2024, 2026, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -23,7 +23,7 @@
/*
* @test
* @bug 6402717 8330606
* @bug 6402717 8330606 8376295
* @summary Redefine VerifyError to get a VerifyError should not throw SOE
* @requires vm.jvmti
* @library /test/lib
@ -33,10 +33,17 @@
* java.instrument
* jdk.jartool/sun.tools.jar
* @run main RedefineClassHelper
*
* @run main/othervm/timeout=180
* -javaagent:redefineagent.jar
* -Xlog:class+init,exceptions
* RedefineVerifyError
*
* @run main/othervm/timeout=180
* -javaagent:redefineagent.jar
* -Xlog:class+init,exceptions
* -XX:-BytecodeVerificationRemote
* RedefineVerifyError
*/
import org.objectweb.asm.AnnotationVisitor;