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

David Holmes dholmes at openjdk.org
Thu Feb 6 07:03:19 UTC 2025


On Wed, 5 Feb 2025 14:04:18 GMT, Amit Kumar <amitkumar at openjdk.org> wrote:

>> Thanks David and Johan for the reviews.
>
> Hi @coleenp, 
> 
> I am repeating the message from Theresa, since she is part of OpenJ9 and can't accept  OpenJDK Terms: 
> 
> 
> `serviceability/jvmti/RedefineClasses/RedefineVerifyError.java` I believe the correct behavior should be throwing a ClassFormatException since the generated class is not well formed.
> 
> According to the JVM specification in section 4.7.3 The Code Attribute:
> 
> If the method is either native or abstract, and is not a class or interface
> initialization method, then its method_info structure must not have a Code attribute
> in its attributes table. Otherwise, its method_info structure must have exactly
> one Code attribute in its attributes table.
> also
> The value of code_length must be greater than zero
> 
> Can you clarify why VerifyError is expected to be caught here?

Hi Amit (@offamitkumar ),

I think the answer to that is already given above:

https://github.com/openjdk/jdk/pull/22116#discussion_r1850265592

> 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 Comment: https://git.openjdk.org/jdk/pull/22116#issuecomment-2638992732


More information about the hotspot-runtime-dev mailing list