RFR: 8365556: ObjectMonitor::try_lock_or_add_to_entry_list() returns true with the wrong state of the node
Anton Artemov
duke at openjdk.org
Fri Aug 15 14:04:09 UTC 2025
On Fri, 15 Aug 2025 13:58:43 GMT, Patricio Chilano Mateo <pchilanomate 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.
Yes, a part of my changes was fiddling with an ObjectWaiter object. So I made a different flow. Nevertheless, this has to be fixed, because it is not correct.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/26794#issuecomment-3191575780
More information about the hotspot-runtime-dev
mailing list