RFR: 8345543: Test serviceability/jvmti/vthread/StopThreadTest/StopThreadTest.java failed: expected JVMTI_ERROR_OPAQUE_FRAME instead of: 0 [v2]

Serguei Spitsyn sspitsyn at openjdk.org
Wed Jan 15 19:29:07 UTC 2025


> The problem is that the state of the target `vthread` is changed to `BLOCKED` too early. It is done in a constructor of helper object `JavaThreadBlockedOnMonitorEnterState` which sets the state of `vthread` to `JavaThreadStatus::BLOCKED_ON_MONITOR_ENTER`. The `vthread` is getting suspended in `try_preempt()` while calling `JvmtiVTMSTransitionDisabler::start_VTMS_transition()`, so does not become unmounted as it is expected by the failing test. Also, it seems that the base class of the `JavaThreadBlockedOnMonitorEnterState` is supporting just HotSpot  `JavaThread`'s and so, it is changing the carrier thread state only.
> 
> The fix is to move the definition of the `JavaThreadBlockedOnMonitorEnterState` object after block where `try_preempt()` is called.
> 
> Testing:
>  - Checked the failed test does not fail with the fix: `serviceability/jvmti/vthread/StopThreadTest/StopThreadTest.java`
>  - Ran mach5 tiers 1-6

Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision:

  review: nit: move curly bracket down

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/23125/files
  - new: https://git.openjdk.org/jdk/pull/23125/files/7312011e..9611d023

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=23125&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=23125&range=00-01

  Stats: 41 lines in 1 file changed: 7 ins; 7 del; 27 mod
  Patch: https://git.openjdk.org/jdk/pull/23125.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/23125/head:pull/23125

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


More information about the hotspot-runtime-dev mailing list