RFR: 8323900: Avoid calling os::init_random() in CDS static dump
Thomas Stuefe
stuefe at openjdk.org
Fri Apr 12 05:55:41 UTC 2024
On Thu, 11 Apr 2024 21:14:39 GMT, Ioi Lam <iklam 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.
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.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/18728#issuecomment-2051028842
More information about the hotspot-dev
mailing list