RFR: 8323900: Avoid calling os::init_random() in CDS static dump

Ioi Lam iklam at openjdk.org
Wed Apr 17 05:34:02 UTC 2024


On Fri, 12 Apr 2024 05:53:21 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>>> Thinking about this, since global entropy (archived object ihashes) sneak into archives whether we use local seeds or not, maybe we should not bother with such a patch.
>>> 
>>> In other words, if global state affects the archive anyway, we may just as well roll with it.
>>> 
>>> See #18735
>> 
>> In CDS, we intend to be as much independent of the global JVM state as possible. For example, since [JDK-8296344](https://bugs.openjdk.org/browse/JDK-8296344), we no longer make a copy of the the archived heap objects in the actual Java heap.
>> 
>> The intention of this PR is the same -- the contents of archived Symbols should not depend on the value of the os::random() seed.
>> 
>> In #18735 you found that some other contents of the CDS archive depend on the JVM's os::random() seed. That may be something we want to fix separately. In any case, that's not a reason to not proceed with this PR.
>
>> > Thinking about this, since global entropy (archived object ihashes) sneak into archives whether we use local seeds or not, maybe we should not bother with such a patch.
>> > In other words, if global state affects the archive anyway, we may just as well roll with it.
>> > See #18735
>> 
>> In CDS, we intend to be as much independent of the global JVM state as possible. For example, since [JDK-8296344](https://bugs.openjdk.org/browse/JDK-8296344), we no longer make a copy of the the archived heap objects in the actual Java heap.
>> 
>> The intention of this PR is the same -- the contents of archived Symbols should not depend on the value of the os::random() seed.
>> 
>> In #18735 you found that some other contents of the CDS archive depend on the JVM's os::random() seed. That may be something we want to fix separately. In any case, that's not a reason to not proceed with this PR.
> 
> Okay. Thinking about this, an isolated seed is always better, since it provides safety against concurrent uses of os::random (which can happen even at initialization time). 
> 
> So my approval stands.

Thanks @tstuefe and @calvinccheung for the review.

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

PR Comment: https://git.openjdk.org/jdk/pull/18728#issuecomment-2060384869


More information about the hotspot-dev mailing list