RFR: Some AOTCodeCache cleanup after merge from mainline [v2]

Vladimir Kozlov kvn at openjdk.org
Wed May 14 19:44:15 UTC 2025


On Wed, 14 May 2025 18:53:03 GMT, Ashutosh Mehra <asmehra at openjdk.org> wrote:

>> The test hit assert running CDS test on Windows. I attached hs_err_pid44896.log to [JDK-8354887](https://bugs.openjdk.org/browse/JDK-8354887) since this one does not have JBS entry.
>> 
>> 
>> #  Internal Error (\workspace\open\src\hotspot\share\utilities/globalDefinitions.hpp:439), pid=44896, tid=37336
>> #  assert(left >= right) failed: avoid underflow - left: 0x00000008003ba598 right: 0x000001ec04000000
>> 
>> V  [jvm.dll+0x173eb]  pointer_delta+0x4b  (globalDefinitions.hpp:439)
>> V  [jvm.dll+0x2a29a8]  AOTCodeCache::write_method+0x188  (aotCodeCache.cpp:2646)
>> V  [jvm.dll+0x2a2756]  AOTCodeCache::write_metadata+0xa6  (aotCodeCache.cpp:2516)
>> V  [jvm.dll+0x2a34fb]  AOTCodeCache::write_nmethod+0x7bb  (aotCodeCache.cpp:1720)
>> V  [jvm.dll+0x2a18e2]  AOTCodeCache::store_nmethod+0x122  (aotCodeCache.cpp:1564)
>> V  [jvm.dll+0x52dd98]  ciEnv::register_method+0x458  (ciEnv.cpp:1260)
>
>> The test hit assert running CDS test on Windows. I attached hs_err_pid44896.log to [JDK-8354887](https://bugs.openjdk.org/browse/JDK-8354887) since this one does not have JBS entry.
> 
> I think this assert comes from:
> 
> uint AOTCacheAccess::delta_from_shared_address_base(address addr) {
>   if (CDSConfig::is_dumping_final_static_archive()) {
>     assert(ArchiveBuilder::is_active(), "must be");
>     ArchiveBuilder* builder = ArchiveBuilder::current();
>     address requested_addr = builder->to_requested(builder->get_buffered_addr(addr));
>     return (uint)pointer_delta(requested_addr, (address)SharedBaseAddress, 1);
>   } else {
>     // Old CDS+AOT workflow.
>     return (uint)pointer_delta(addr, (address)SharedBaseAddress, 1);
>   }
> } 
> 
> The error log file shows SharedBaseAddress is `0x000001ec04000000` which matches with the value printed by the assert.

@ashu-mehra Can you look why it could happened?

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

PR Comment: https://git.openjdk.org/leyden/pull/66#issuecomment-2881356446


More information about the leyden-dev mailing list