RFR: 8268285: vmTestbase/nsk/jvmti/GetThreadState/thrstat002 failed with "Wrong thread "thr1" (...) state after SuspendThread" [v4]

Serguei Spitsyn sspitsyn at openjdk.java.net
Thu Jun 10 06:06:41 UTC 2021


> The test is intermittently failing because the tested thread thrstat002a is blocked on a monitor in the PrintStream.println(String) when it is expected to be in the RUNNABLE state:
>   thrstat002.runningBarrier.unlock(); <= now the thrstat002 state can be checked and suspend issued
>   System.out.println("thrstat002a.run after runningBarrier unlock"); <= blocked on the monitor in here
> 
> The fix is to move println line to the point before thrstat002.runningBarrier.unlock();
> Also, a fflush(0) statement is added to the agent *_checkStatus() function to get output better sync'ed.

Serguei Spitsyn has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision:

 - Merge
 - Merge
 - add a warning comment to thrstat002a.run to prevent println's before the while loop
 - 8268285: fix failure in test vmTestbase/nsk/jvmti/GetThreadState/thrstat002

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/4447/files
  - new: https://git.openjdk.java.net/jdk/pull/4447/files/07bdb421..6ef8ccc6

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4447&range=03
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4447&range=02-03

  Stats: 84 lines in 3 files changed: 22 ins; 9 del; 53 mod
  Patch: https://git.openjdk.java.net/jdk/pull/4447.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/4447/head:pull/4447

PR: https://git.openjdk.java.net/jdk/pull/4447


More information about the serviceability-dev mailing list