RFR: 8370248: AOTMapLogger should check if pointer is in AOTMetaspace
Ioi Lam
iklam at openjdk.org
Wed Oct 22 06:04:12 UTC 2025
On Tue, 21 Oct 2025 16:02:27 GMT, Vladimir Kozlov <kvn 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()`.
>
> Good.
Thanks @vnkozlov @adinn for the review
-------------
PR Comment: https://git.openjdk.org/jdk/pull/27918#issuecomment-3430614512
More information about the hotspot-runtime-dev
mailing list