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

Patricio Chilano Mateo pchilanomate at openjdk.org
Fri Aug 15 14:01:11 UTC 2025


On Fri, 15 Aug 2025 13:53:48 GMT, Anton Artemov <duke at openjdk.org> wrote:

> Yes I was, but I think a crash is possible even with the current state of things. The path I was thinking is: `wait() -> enter() -> enter_with_contention_mark() -> enter_internal() -> try_lock_or_add_to_entry_list()`. I think a guarantee statement on line 1944 would be broken if `try_lock_or_add_to_entry_list()` returned true without changing the state.
>
Right, but note that in that path we create a new `ObjectWaiter`. The one referenced in the assert on line 1944 is the original one.

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

PR Comment: https://git.openjdk.org/jdk/pull/26794#issuecomment-3191568445


More information about the hotspot-runtime-dev mailing list