[crac] RFR: Move CPUFeatures verification to the parent process of JVM
Radim Vansa
rvansa at openjdk.org
Wed Apr 30 07:43:03 UTC 2025
On Tue, 29 Apr 2025 13:25:55 GMT, Jan Kratochvil <jkratochvil at openjdk.org> wrote:
>> There was originally a mistake:
>> - restoring JVM did restore the image
>> - the restored JVM started checking whether CPU Features of the new host >= CPU Features of the checkpoint host
>>
>> That is difficult as glibc is already configured (IFUNC) in the image for the checkpoint host and calling any such glibc functions in the restored image will crash (as the advanced instructions from misconfigured IFUNC are not available). Some glibc functions had to be reimplemented in a dummy way inside JVM due to this misdesign.
>>
>> This patch changes it to:
>> - restoring JVM checks `cpufeatures` user data in the image against current CPU Features
>> - the restored JVM is started only if the CPU Features are satisfied, restored JVM no longer has to verify anything
>>
>> The patch is a bit of a kitchen sink, there are various improvements of the CPU Features code.
>
> That one failure: `Pre-submit tests - linux-x64 / test - Build / test` = `jdk/crac/fileDescriptors/LoggingVMlogOpenTestNegative.java` will IMO disappear after the change gets accepted. The testcase has been changed so that if you run it from the freshly built JVM it works. But Github IIUC runs the parent JVM pre-built, not from the fresh build: `/home/runner/work/crac/crac/bundles/jdk/jdk-25/bin/java`. Or where is this `bundle` JVM from?
@jankratochvil The test is failing for me locally, too - does it pass on your machine?
Could you create JDK issue and refer to that in the title?
-------------
PR Comment: https://git.openjdk.org/crac/pull/227#issuecomment-2841090563
More information about the crac-dev
mailing list