RFR: 8353117: Crash: assert(id >= ThreadIdentifier::initial() && id < ThreadIdentifier::current()) failed: must be reasonable)
David Holmes
dholmes at openjdk.org
Tue Apr 1 07:32:32 UTC 2025
On Mon, 31 Mar 2025 18:15:39 GMT, Patricio Chilano Mateo <pchilanomate at openjdk.org> wrote:
> Please review the following fix. For the attaching thread case we are incorrectly setting the `_monitor_owner_id` after `Threads::add()` is called, i.e after the attaching thread becomes visible through a ThreadsListHandle. So if another thread calls `Threads::owning_thread_from_monitor()` in between these events and iterates through all JavaThreads looking for the owner of a given monitor, we might find this attaching thread still with a `_monitor_owner_id` of 0.
> I corrected the ordering and improved verification checks. Tested in mach5 tiers1-5.
>
> Thanks,
> Patricio
That seems fine to me. Thanks for fixing.
-------------
Marked as reviewed by dholmes (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/24336#pullrequestreview-2731738289
More information about the hotspot-dev
mailing list