Integrated: 8370248: AOTMapLogger should check if pointer is in AOTMetaspace

Ioi Lam iklam at openjdk.org
Wed Oct 22 06:04:13 UTC 2025


On Tue, 21 Oct 2025 15:37:06 GMT, Ioi Lam <iklam at openjdk.org> wrote:

> This fixes a recent bug in `AOTMapLogger` that's exposed in macOS 26 testing.
> 
> When running the JVM with a valid AOT cache (or AOT cache) with the flag `-Xlog:aot+map=debug`, we use `AOTMapLogger::RuntimeGatherArchivedMetaspaceObjs` to discover all metaspace objects that are contained in the AOT cache.
> 
> However, this code is executed after some of the AOT-cached classes are linked. As a result, `RuntimeGatherArchivedMetaspaceObjs::do_unique_ref()` could see instances of `AdapterHandlerEntry` which are dynamically allocated and their addresses are outside of the AOT cache.
> 
> In all platforms except macOS 26, the `AdapterHandlerEntry` pointers are all above the address range of the AOT cache, and they are filtered out by subsequent code in `AOTMapLogger`. However, on macOS 26, the `AdapterHandlerEntry` pointers are below the AOT cache, and they caused this assert to fail:
> 
> https://github.com/openjdk/jdk/blob/9a88d7f468cdd040bdf4e1ff9441dc9c66eab03e/src/hotspot/share/cds/aotMapLogger.cpp#L240-L242
> 
> The fix is simple: filter out all pointers that are outside of the address range of the AOT cache in `do_unique_ref()`.

This pull request has now been integrated.

Changeset: 70e78615
Author:    Ioi Lam <iklam at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/70e786154fae78c0dacaa3e29c7aa4d3d14b892b
Stats:     8 lines in 1 file changed: 2 ins; 0 del; 6 mod

8370248: AOTMapLogger should check if pointer is in AOTMetaspace

Reviewed-by: kvn, adinn

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

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


More information about the hotspot-runtime-dev mailing list