RFR: 8328236: module_entry in CDS map file has stale value
Ioi Lam
iklam at openjdk.org
Fri Mar 15 05:39:06 UTC 2024
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)
-------------
Commit messages:
- 8328236: module_entry in CDS map file has stale value
Changes: https://git.openjdk.org/jdk/pull/18320/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=18320&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8328236
Stats: 19 lines in 2 files changed: 10 ins; 0 del; 9 mod
Patch: https://git.openjdk.org/jdk/pull/18320.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/18320/head:pull/18320
PR: https://git.openjdk.org/jdk/pull/18320
More information about the hotspot-runtime-dev
mailing list