On Wed, 21 Feb 2024 10:28:49 GMT, Serguei Spitsyn <sspit...@openjdk.org> wrote:

> The implementation of the JVM TI `GetCurrentContendedMonitor()` does not 
> match the spec. It can sometimes return an incorrect information about the 
> contended monitor. Such a behavior does not match the function spec. 
> With this update the `GetCurrentContendedMonitor()` is returning the monitor 
> only when the specified thread is waiting to enter or re-enter the monitor, 
> and the monitor is not returned when the specified thread is waiting in the 
> `java.lang.Object.wait` to be notified.
> 
> The implementations of the JDWP `ThreadReference.CurrentContendedMonitor` 
> command and JDI `ThreadReference.currentContendedMonitor()` method are based 
> and depend on this JVMTI function. The JDWP command and the JDI method were 
> specified incorrectly and had incorrect behavior. The fix slightly corrects 
> both the JDWP and JDI specs. The JDWP and JDI implementations have been also 
> fixed because they use this JVM TI update. Please, see and review the related 
> CSR and Release-Note.
> 
> CSR: [8326024](https://bugs.openjdk.org/browse/JDK-8326024): JVM TI 
> GetCurrentContendedMonitor is implemented incorrectly
> RN:   [8326038](https://bugs.openjdk.org/browse/JDK-8326038): Release Note: 
> JVM TI GetCurrentContendedMonitor is implemented incorrectly
> 
> Testing:
>  - tested with the mach5 tiers 1-6

This pull request has now been integrated.

Changeset: 33aa4b26
Author:    Serguei Spitsyn <sspit...@openjdk.org>
URL:       
https://git.openjdk.org/jdk/commit/33aa4b26b190927241a81fd1cba6fe262a5b1da0
Stats:     73 lines in 10 files changed: 41 ins; 15 del; 17 mod

8256314: JVM TI GetCurrentContendedMonitor is implemented incorrectly

Reviewed-by: dholmes, lmesnik

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

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

Reply via email to