RFR: 8323556: CDS archive space addresses should be randomized with ArchiveRelocationMode=1 [v2]

Calvin Cheung ccheung at openjdk.org
Wed Jan 17 17:27:50 UTC 2024


On Wed, 17 Jan 2024 02:28:45 GMT, Ioi Lam <iklam at openjdk.org> wrote:

> Does this code conflict with the call to `os::init_random(0x12345678)` in [ VM_PopulateDumpSharedSpace::doit()](https://github.com/openjdk/jdk/blob/2063bb8ffabd6096f547ec6da979cfcf68a56ba3/src/hotspot/share/cds/metaspaceShared.cpp#L499-L517)?

Not sure. Without the above static dump check, the `DeterministicDump.java` test failed.

> 
> I think it's better to remove the call to os::init_random(), and change the following call to
> 
> ```
> const int start_index = aslr ? os::next_random(int)os::javaTimeNanos()) : 0;
> ```

I tried the above change and it works.

> 
> That way we can avoid modifying a global state that may affect other VM components.
> 
> I also created https://bugs.openjdk.org/browse/JDK-8323900 to avoid calling `os::init_random(0x12345678)`

Thanks.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17409#discussion_r1456137520


More information about the hotspot-runtime-dev mailing list