RFR: 8328236: module_entry in CDS map file has stale value

Ioi Lam iklam at openjdk.org
Sat Mar 16 22:24:31 UTC 2024


On Fri, 15 Mar 2024 20:08:45 GMT, Matias Saavedra Silva <matsaave at openjdk.org> wrote:

>> When a `java.lang.Module` object is copied into the CDS archive, we clear its `module_entry` field to 0. However, the information printed in the cds.map file still shows a non-zero value:
>> 
>> $ java -Xshare:dump -Xlog:cds+map=debug,cds+map+oops=trace:file=cds.map:none:filesize=0
>> $ cat cds.map | grep module_entry
>> ...
>>  - injected 'module_entry' 'J' @16  140166528907408 (0x00007f7b102a3890)
>> 
>> 
>> The reason is the above is printed using the "original" Module object whose `module_entry` is not cleared. We only clear  this object's "buffered copy", which is the one that gets written into the CDS archive.
>> 
>> The fix is to change the printing code to use the "buffered copy" instead. Now it looks like this:
>> 
>> 
>>  - injected 'module_entry' 'J' @16  0 (0x0000000000000000)
>
> LGTM, thanks!

Thanks @matias9927 @calvinccheung for the review.

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

PR Comment: https://git.openjdk.org/jdk/pull/18320#issuecomment-2001711374


More information about the hotspot-runtime-dev mailing list