[crac] RFR: 8372933: [CRaC] Restore failed due to incompatible or missing CPU features, try using -XX:CPUFeatures=0xfoo, 0xbar on checkpoint [v2]
Radim Vansa
rvansa at openjdk.org
Wed Jan 7 16:26:26 UTC 2026
On Sun, 4 Jan 2026 22:19:39 GMT, Jan Kratochvil <jkratochvil at openjdk.org> wrote:
>> Since [JDK-8368929](https://bugs.openjdk.org/browse/JDK-8368929) the message:
>>
>>
>> Restore failed due to incompatible or missing CPU features, try using -XX:CPUFeatures=0xe14e1805fdfbf7,0xfcc on checkpoint.
>>
>>
>> is wrong as it does not do logical and of both CPUFeatures masks.
>>
>> Yes, I should have caught it during [JDK-8368929](https://bugs.openjdk.org/browse/JDK-8368929) review.
>>
>> @rvansa will probably want to change the API but this is a PoC how it should work.
>
> Jan Kratochvil has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains five additional commits since the last revision:
>
> - return original prototype of is_failed(), add new get_failed_bitmap()
> - !EQUALS->SUBSET
> - conjunction->intersection
> - Merge branch 'crac' into crac-conjunction
> - 8372933: [CRaC] Restore failed due to incompatible or missing CPU features, try using -XX:CPUFeatures=0xfoo,0xbar on checkpoint
src/hotspot/share/include/crlib/crlib_image_constraints.h line 67:
> 65: bool (*is_failed)(crlib_conf_t *, const char *name);
> 66:
> 67: // For failed require_bitmap it will copy the expected value to the provided buffer.
I would expect this function to return the stored bitmap value (and you'd calculate the intersection only in the caller). If you want to use the current semantics please elaborate in the docs what is the 'expected value' for each of the `crlib_bitmap_comparison_t`.
src/java.base/share/native/libcrexec/image_constraints.hpp line 83:
> 81: const void* data;
> 82: size_t data_size;
> 83: const void* intersection; // data_size
I think you can make this just (non-const) `unsigned char *` rather than all the nasty casts when computing the intersection.
src/java.base/share/native/libcrexec/image_constraints.hpp line 94:
> 92: data = o.data;
> 93: data_size = o.data_size;
> 94: intersection = o.intersection;
missing `o.intersection = nullptr`
src/java.base/share/native/libcrexec/image_constraints.hpp line 147:
> 145: if (!strcmp(c.name, name) && c.failed) {
> 146: result = true;
> 147: if (value_return && c.intersection && value_size == c.data_size) {
If `value_size != c.data_size` this will return `true`. I guess that if this won't report the required size it should just return false.
-------------
PR Review Comment: https://git.openjdk.org/crac/pull/278#discussion_r2669119837
PR Review Comment: https://git.openjdk.org/crac/pull/278#discussion_r2669098826
PR Review Comment: https://git.openjdk.org/crac/pull/278#discussion_r2669074064
PR Review Comment: https://git.openjdk.org/crac/pull/278#discussion_r2669087388
More information about the crac-dev
mailing list