On Wed, 25 Mar 2026 18:48:40 GMT, Vladimir Kozlov <[email protected]> wrote:
>> # Issue
>> Many AppCDS test asserts with `assert(false) failed: Address
>> 0x00007f0dfc2923e0 for <unknown>/('verify_oop: r11: broken oop oop_result,
>> "broken oop in call_VM_base"
>> (src/hotspot/cpu/x86/macroAssembler_x86.cpp:1353)') is missing in AOT Code
>> Cache addresses table` when run with `-Xcomp --enable-preview`
>>
>> # Cause
>> The crash happens during AOT cache dumping seemingly because
>> `-XX:+VerifyOops` causes the adapter to use addresses that the AOT doesn't
>> know about. In particular, `verify_oop`/`verify_oop_addr` add a message
>> C‑string and reference the verify‑oop stub entry.
>> `AOTCodeCache::write_relocations()` tries to serialize those relocations,
>> `AOTCodeAddressTable::id_for_address()` can’t resolve them and crashes.
>> In this case the issue happens with `--enable-preview` because it creates an
>> adapter for scalarized arguments and, after creating the oop from the
>> arguments, `get_vm_result_oop` invokes `verify_oop_msg`. Without
>> `--enable-preview` the path is never taken and the missing "registration"
>> isn’t exercised (I fear that this crash could potentially be triggered by
>> some other (non preview) code but the fix doesn't need to distinguish
>> between preview/non-preview).
>>
>> # Fix
>> Apparently we need to make the two addresses used by `verify_oop_msg`
>> "visible" to AOT: register the debug message string and add
>> `StubRoutines::verify_oop_subroutine_entry_address()` to the AOT “extrs”
>> table.
>>
>> # Testing
>> Tier 1-3+
>> Failing CDS tests before and after
>
> An other solution would be to disable AOT code generation if VerifyOops is on:
>
>
> diff --git a/src/hotspot/share/code/aotCodeCache.cpp
> b/src/hotspot/share/code/aotCodeCache.cpp
> index 68db21850aa..cb7098f8641 100644
> --- a/src/hotspot/share/code/aotCodeCache.cpp
> +++ b/src/hotspot/share/code/aotCodeCache.cpp
> @@ -188,14 +188,14 @@ void AOTCodeCache::initialize() {
> FLAG_SET_ERGO(AOTStubCaching, false);
>
> if (VerifyOops) {
> - // Disable AOT stubs caching when VerifyOops flag is on.
> + // Disable AOT code caching when VerifyOops flag is on.
> // Verify oops code generated a lot of C strings which overflow
> // AOT C string table (which has fixed size).
> // AOT C string table will be reworked later to handle such cases.
> //
> - // Note: AOT adapters are not affected - they don't have oop operations.
> - log_info(aot, codecache, init)("AOT Stubs Caching is not supported with
> VerifyOops.");
> - FLAG_SET_ERGO(AOTStubCaching, false);
> + log_info(aot, codecache, init)("AOT Code Caching is not supported with
> VerifyOops.");
> + disable_caching();
> + return;
> }
>
> bool is_dumping = false;
Thank you @vnkozlov!
Disabling the AOT seems actually a more sensible solution (even though my tests
showed just a few C strings recorded) but I've only added the disabling of the
adapter part (`FLAG_SET_ERGO(AOTAdapterCaching, false);`) instead of disabling
all the caching. Does it make sense?
-------------
PR Comment: https://git.openjdk.org/valhalla/pull/2233#issuecomment-4133444116