[crac] RFR: 8370888: [CRaC] Use better source of random for UUID generation in checkpoint path

Radim Vansa rvansa at openjdk.org
Thu Oct 30 14:17:08 UTC 2025


On Thu, 30 Oct 2025 12:00:41 GMT, Timofei Pushkin <tpushkin at openjdk.org> wrote:

>> When `-XX:CRaCCheckpointTo` contains the `%u` placeholder to generate random UUID, it should use a different source than `os::random()` which provides not-seeded, deterministic values.
>
> src/hotspot/os/posix/crac_posix.cpp line 63:
> 
>> 61:   for (size_t i = 0; i < length; i += sizeof(int)) {
>> 62:     int value = os::next_random(seed);
>> 63:     seed = value;
> 
> Is there a reason not to use `os::init_random` and `os::random`? It would be just a bit simpler.

I am not sure why `os::init_random` is not called anywhere AFAICT, but initializing it randomly (with time) could be intrusive; it can be intentionally deterministic based on the seed.

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

PR Review Comment: https://git.openjdk.org/crac/pull/271#discussion_r2478280626


More information about the crac-dev mailing list