RFR: 8358680: AOT cache creation fails: no strings should have been added
Ioi Lam
iklam at openjdk.org
Tue Jun 17 16:24:30 UTC 2025
On Tue, 17 Jun 2025 15:49:38 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
> Would be nice to avoid divergence between JDK 25, JDK 26 and Leyden/premain.
>
> Anyhow, I now think this fix in incomplete. In premain, we use this `wait_for_no_active_tasks`, because we _know_ all the compiler tasks were queued, and we just need to run them down. But here, we still have a race: compiler threads may finish current batch of compilations, `wait_for_no_active_tasks` would return, and _then_ we can start compiling again.
No Java code is executing at this point (we are in the only thread that can run Java code). Is there still a possibility for new compile tasks to be added?
> I think we need to figure our when we dump the shared table. Maybe even shutdown the compiler right before going into CDS dump? See how `CompileBroker::set_should_block` and `VM_Exit::wait_for_threads_in_native_to_block` do it. It would still be pretty awkward for a fix.
In Leyden, we run the AOT compiler after the CDS dumping has finished, so if we shut down the compiler we would have to restart it.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/25816#issuecomment-2981014094
More information about the hotspot-dev
mailing list