Integrated: 8353117: Crash: assert(id >= ThreadIdentifier::initial() && id < ThreadIdentifier::current()) failed: must be reasonable)

Patricio Chilano Mateo pchilanomate at openjdk.org
Wed Apr 2 14:35:07 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

This pull request has now been integrated.

Changeset: d32ff139
Author:    Patricio Chilano Mateo <pchilanomate at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/d32ff1392205ea0fd179478a7ddb3d5f63923461
Stats:     30 lines in 7 files changed: 20 ins; 6 del; 4 mod

8353117: Crash: assert(id >= ThreadIdentifier::initial() && id < ThreadIdentifier::current()) failed: must be reasonable)

Reviewed-by: dholmes, fbredberg

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

PR: https://git.openjdk.org/jdk/pull/24336


More information about the hotspot-dev mailing list