[crac] RFR: 8372933: [CRaC] Restore failed due to incompatible or missing CPU features, try using -XX:CPUFeatures=0xfoo, 0xbar on checkpoint [v6]
Jan Kratochvil
jkratochvil at openjdk.org
Mon Feb 2 20:30:31 UTC 2026
On Mon, 2 Feb 2026 08:06:40 GMT, Radim Vansa <rvansa at openjdk.org> wrote:
>> Jan Kratochvil has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Fix non-x86 builds
>
> src/hotspot/share/include/crlib/crlib_image_constraints.h line 68:
>
>> 66:
>> 67: // For failed require_bitmap it will copy value from the image to the provided buffer.
>> 68: bool (*get_failed_bitmap)(crlib_conf_t *, const char *name, unsigned char *value_return, size_t value_size);
>
> From this API, I don't see how you'd get to know the size of the stored value. Could you either report that as the return value (`-1` => error retrieving, `0` => bitmap missing or empty)?
> Alternatively `value_size` could be an in-out argument. (the former would be inline with `crlib_restore_data::get_restore_data`, the latter is used in `crlib_user_data::lookup_user_data`)
> And add a comment describing the return value/parameter.
Currently, if the size does not match, it always fails:
if (value_return) {
if (!c.image_data || value_size != c.data_size) {
result = false;
This means that the version of OpenJDK used for restoring is different from the one used for snapshotting, which will result in:
log_error(crac)("Restore failed due to incompatible or missing CPU features, try using -XX:CPUFeatures=%s on checkpoint.", image_features.print_numbers());
} else {
--> log_error(crac)("Restore failed due to incompatible or missing CPU features.");
It would be possible, but difficult, to print the CPU features if their size differs from `sizeof(VM_Version::VM_Features)`. I don't think we need to support running mismatched OpenJDK versions extensively.
-------------
PR Review Comment: https://git.openjdk.org/crac/pull/278#discussion_r2756030192
More information about the crac-dev
mailing list