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

David Holmes dholmes at openjdk.org
Thu Nov 21 05:15:17 UTC 2024


On Wed, 20 Nov 2024 12:52:45 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> 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.

Wow that is pretty developer unfriendly. Hopefully exception logging will still show what the error is in detail.

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

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


More information about the serviceability-dev mailing list