RFR: 8330606: Redefinition doesn't but should verify the new klass [v3]

Coleen Phillimore coleenp at openjdk.org
Wed Nov 20 12:55:26 UTC 2024


On Wed, 20 Nov 2024 03:42:57 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Coleen Phillimore has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Reduce test, fix bug in verifier, move and add comments to is_eligible_for_verification.
>
> test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/RedefineVerifyError.java line 96:
> 
>> 94:             throw new RuntimeException("This should throw VerifyError");
>> 95:         } catch (VerifyError e) {
>> 96:             // JVMTI recreates the VerifyError so the verification message is lost.
> 
> I'm not clear why JVMTI would mess with the `VerifyError` that the verifier should have raised, and which explains the reason why verification failed. Not that your changes impact that.

The JVMTI code for redefinition returns JVMTI_ERROR_FAILS_VERIFICATION and not the pending exception to the caller.  The agent eventually in java.instrument/share/native/libinstrument/JavaExceptions.c will recreate the VerifyError based on the JVMTI error code.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/22116#discussion_r1850265592


More information about the serviceability-dev mailing list