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

Ioi Lam iklam at openjdk.org
Sat Mar 16 22:24:35 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)

This pull request has now been integrated.

Changeset: 07194195
Author:    Ioi Lam <iklam at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/07194195cefc568048fa639b6f8534ce3718c8d2
Stats:     19 lines in 2 files changed: 10 ins; 0 del; 9 mod

8328236: module_entry in CDS map file has stale value

Reviewed-by: ccheung, matsaave

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

PR: https://git.openjdk.org/jdk/pull/18320


More information about the hotspot-runtime-dev mailing list