[crac] RFR: 8372933: [CRaC] Restore failed due to incompatible or missing CPU features, try using -XX:CPUFeatures=0xfoo, 0xbar on checkpoint [v5]
Timofei Pushkin
tpushkin at openjdk.org
Mon Feb 2 15:43:35 UTC 2026
On Mon, 2 Feb 2026 15:02:07 GMT, Jan Kratochvil <jkratochvil at openjdk.org> wrote:
>> src/hotspot/share/runtime/crac_engine.cpp line 514:
>>
>>> 512: image_features &= *datap;
>>> 513: }
>>> 514: log_error(crac)("Restore failed due to incompatible or missing CPU features, try using -XX:CPUFeatures=%s on checkpoint.", image_features.print_numbers());
>>
>> In the exact case with this wording I believe `datap` should be printed, not `image_features`. Maybe it's a good idea to rename `datap` to `current_features` to avoid confusion, and also make it a reference instead of a pointer.
>
> Fixed the exact case, thanks. Renamed it to `current_features` everywhere.
>
> I normally used references for any non-null pointer everywhere but OpenJDK does not do that. I haven't found a coding style rule for it but apparently OpenJDK discourages references. Why do you suggest to use a reference here?
I usually use a pointer-to-class/struct parameter only if it either nullable, the function actually needs a pointer (e.g. does pointer arithmetic), or the function mutates the object (i.e. it's a non-const reference). And even the last two are debatable. Otherwise using a pointer makes the syntax bulkier and makes the function declaration less self-documenting (a pointer allows null).
-------------
PR Review Comment: https://git.openjdk.org/crac/pull/278#discussion_r2754961913
More information about the crac-dev
mailing list