RFR: 8365556: ObjectMonitor::try_lock_or_add_to_entry_list() returns true with the wrong state of the node

Fredrik Bredberg fbredberg at openjdk.org
Fri Aug 15 11:35:12 UTC 2025


On Fri, 15 Aug 2025 07:22:02 GMT, Anton Artemov <duke at openjdk.org> wrote:

> Hi, please consider the following change:
> 
> ObjectMonitor::try_lock_or_add_to_entry_list() does not change the node state to TS_RUN in case of a successful acquisition of the object monitor. In certain cases this can brake the guarantee statement in the ObjectMonitor::wait() method and lead to a crash. The missing statement is added.
> 
> Tested in tiers 1 - 5.

Thank you @toxaart for spotting, and fixing this.

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

Marked as reviewed by fbredberg (Committer).

PR Review: https://git.openjdk.org/jdk/pull/26794#pullrequestreview-3123658866


More information about the hotspot-runtime-dev mailing list