RFR: 8358680: AOT cache creation fails: no strings should have been added

Ioi Lam iklam at openjdk.org
Mon Jun 16 03:39:27 UTC 2025


On Mon, 16 Jun 2025 03:30:40 GMT, Ioi Lam <iklam at openjdk.org> wrote:

> Background: when writing the string table in the AOT cache, we do this:
> 
> 1. Find out the number of strings in the interned string table
> 2. Allocate Java object arrays that are large enough to store these strings. These arrays are used by `StringTable::lookup_shared()` in the production run.
> 3. Enter safepoint
> 4. Copy the strings into the arrays
> 
> This bug happened because:
> 
> - Step 1 is not thread safe, so it may be reading a stale version of `_items_count`
> - JIT compiler threads may create more interned strings after step 1
> 
> This PR attempts to fix both issues.

@shipilev I copied the part of your [JDK-8352042: [leyden] Parallel precompilation](
https://github.com/openjdk/leyden/commit/92203ef8a1d840a073958abeee3b0494d83a0780) changes from the Leyden repo that implements `CompileBroker::wait_for_no_active_tasks()`.

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

PR Comment: https://git.openjdk.org/jdk/pull/25816#issuecomment-2975005251


More information about the hotspot-dev mailing list