[crac] RFR: 8372933: [CRaC] Restore failed due to incompatible or missing CPU features, try using -XX:CPUFeatures=0xfoo, 0xbar on checkpoint

Radim Vansa rvansa at openjdk.org
Tue Dec 2 13:47:47 UTC 2025


On Tue, 2 Dec 2025 13:22:18 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.
> 
> It is in fact untested as I haven't run it with CRIU yet.

A test update along with a bugfix would be welcome.

src/hotspot/share/include/crlib/crlib_image_constraints.h line 66:

> 64:   // if multiple images are considered for restore this method should always return false.
> 65:   // For failed require_bitmap it will copy the expected value to the provided buffer.
> 66:   bool (*is_failed)(crlib_conf_t *, const char *name, unsigned char *value_return);

We should not change the API in a breaking way like this; rather add a new, more suitable method (a size-based check can validate if the method can be used).

The change as you add it accommodates (based on type) only bitmaps, not labels, and does not do any checks on the buffer size.

src/java.base/share/native/libcrexec/image_constraints.cpp line 286:

> 284:       print_bitmap("Constraint:  ", static_cast<const unsigned char*>(c.data), c.data_size);
> 285:       print_bitmap("Image:       ", static_cast<const unsigned char*>(t->data), t->data_size);
> 286:       if (c.comparison != EQUALS) {

You should rather check that this was really a `SUBSET` comparison - in case of `SUPERSET` the desired value would be logical OR. Not sure if we should call it a 'conjuction' or an 'intersection' since we're talking about set.

-------------

PR Review: https://git.openjdk.org/crac/pull/278#pullrequestreview-3530176525
PR Review Comment: https://git.openjdk.org/crac/pull/278#discussion_r2581223249
PR Review Comment: https://git.openjdk.org/crac/pull/278#discussion_r2581247962


More information about the crac-dev mailing list