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

Matias Saavedra Silva matsaave at openjdk.org
Sat Mar 16 22:24:28 UTC 2024


On Fri, 15 Mar 2024 05:33:37 GMT, Ioi Lam <iklam 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!

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

Marked as reviewed by matsaave (Committer).

PR Review: https://git.openjdk.org/jdk/pull/18320#pullrequestreview-1940436769


More information about the hotspot-runtime-dev mailing list