RFR: 8351654: Agent transformer bytecodes should be verified [v3]
Coleen Phillimore
coleenp at openjdk.org
Mon Apr 7 13:26:14 UTC 2025
On Mon, 7 Apr 2025 12:57:48 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
>> test/hotspot/jtreg/runtime/verifier/CFLH/TestVerify.java line 176:
>>
>>> 174: // Now load the class for the VerifyError.
>>> 175: System.out.println("1 hour is " + Duration.ofHours(1).getSeconds() + " seconds");
>>> 176: if (!verifyErrorThrown) {
>>
>> I'm a bit confused about the logic here - are there three possibilities:
>> 1. the load threw VerifyError and will be caught below
>> 2. Another part of the code (where?) threw VerifyError, caught it and set `verifyErrorThrown` to true
>> 3. No verification error occurred at all.
>>
>> How do we trigger case 1 versus case 2?
>
> VerifyError for case 2 is thrown during preinit when we redefine the class, so it's caught and set to a boolean to run the original class, since the redefinition exception was caught.
Yes, this was a bit confusing. The submitted test did the retransform in the preinit. I moved it to the main code.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24333#discussion_r2031233088
More information about the hotspot-runtime-dev
mailing list