RFR: 8253495: CDS generates non-deterministic output [v2]

Ioi Lam iklam at openjdk.java.net
Thu Mar 10 19:44:39 UTC 2022


On Thu, 10 Mar 2022 13:51:56 GMT, Magnus Ihse Bursie <ihse at openjdk.org> wrote:

>> Ioi Lam has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Fixed zero build
>
> I think he already did. I'm quoting:
> 
>> However, the CDS archive also contains a heap dump, which includes Java HashMaps. If I allow those 3 Java threads to start, some HashMaps in the module graph will have unstable ordering. I think the reason is concurrent thread execution causes unstable assignment of the identity_hash for objects in the heap dump.

> @magicus the issue is not the list of classes dumped, or their format in the dump. As Ioi indicated that list is fixed. The issue is with the heap dump part of the archive. Running these other threads affects the heap so by not running them with end up with a different heap. So the question is whether there is anything about having a different heap dumped that we need to be concerned about. We dump the heap into the archive for a reason and this changes what we dump,

To be clear, if multiple threads are running, classes could be loaded in a different order and the symbols will have different orders. This would cause the vtables in Klass objects to be laid out differently. Trying to fix this is very difficult. I have a different patch that makes it work but it's just too complicated.

So, disabling the threads is also necessary for (easily) sorting the metaspace objects.

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

PR: https://git.openjdk.java.net/jdk/pull/7748



More information about the build-dev mailing list