RFR: 8361752: Double free in CompileQueue::delete_all after JDK-8357473
Vladimir Kozlov
kvn at openjdk.org
Mon Jul 14 17:43:38 UTC 2025
On Mon, 14 Jul 2025 17:34:03 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
>> AFAIU, that's the point of the existing protocol to force _waiters_ to delete the task: the blocking waiter would wait for compiler thread to complete the task one way or the other. This PR makes that protocol even stronger: _only_ blocking waiters are allowed to delete the blocking task.
>
> Ah, your question is what happens if we notify here, and compilations are still running? Well, I think current protocol should nominally allow waiters to wait until compilation is over and then allow them to delete the task. But then I see `wait_for_compilation` can exit when compilation is shut down:
>
>
> while (!task->is_complete() && !is_compilation_disabled_forever()) {
> ml.wait();
> }
>
>
> This will proceed to delete the task while compiler thread is running. Grrr. Looks to be another hole in this protocol.
Can compiler thread delete its **own** blocking task when it finished. And let Java thread resume execution when compilation disabled as it do now but do nothing about task in such case?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26294#discussion_r2205472440
More information about the hotspot-compiler-dev
mailing list