RFR: 8358289: [asan] runtime/cds/appcds/aotCode/AOTCodeFlags.java reports heap-buffer-overflow in ArchiveBuilder [v2]
Vladimir Kozlov
kvn at openjdk.org
Tue Jun 3 10:47:25 UTC 2025
> There is difference between AdapterFingerPrint allocation size [compute_size](https://github.com/openjdk/jdk/blob/master/src/hotspot/share/runtime/sharedRuntime.cpp#L2227) which may not be aligned to HeapWord size and [size](https://github.com/openjdk/jdk/blob/master/src/hotspot/share/runtime/sharedRuntime.cpp#L2421) used for copying during AOT cache build which is aligned and can be bigger than allocation size.
>
> I added asserts to `AdapterFingerPrint` and `AdapterHandlerEntry` to make sure sizes are correct. Both are used in AOT cache build.
>
> I also moved `FreeHeap()` from `~AdapterFingerPrint()` to enforce the comment and simplify executed code.
>
> Thanks to @MBaesken for finding the issue and @iklam for pointing the cause.
>
> Testing tier1-3, xcomp, stress. Higher tiers are still running.
Vladimir Kozlov has updated the pull request incrementally with one additional commit since the last revision:
Remove unused argument
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/25604/files
- new: https://git.openjdk.org/jdk/pull/25604/files/b03c5070..9b67ceab
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=25604&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=25604&range=00-01
Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod
Patch: https://git.openjdk.org/jdk/pull/25604.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/25604/head:pull/25604
PR: https://git.openjdk.org/jdk/pull/25604
More information about the hotspot-dev
mailing list