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 06:37:29 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> Coleen Phillimore has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Rewrote the test.
>
> test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleJavaBaseVerify.java line 27:
>
>> 25: * @test
>> 26: * @bug 8351654
>> 27: * @summary Make sure --patch-module for java.base verifies the classfile.
>
> ?? But in this scenario the injected class is not verified.
Fixed.
> 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.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24333#discussion_r2031235153
PR Review Comment: https://git.openjdk.org/jdk/pull/24333#discussion_r2031187366
More information about the hotspot-runtime-dev
mailing list