After receiving the expected 4 ThreadDeathEvents, the test disables the 
ThreadDeathRequest and stops processing events. However, there is already 
another ThreadDeathEvent in flight for the UsageTracker thread. That results in 
suspending all debuggee threads, with the expectation that the debugger will 
eventually process the event and do an eventSet.all(). That never happens, 
leaving the debuggee suspended while the debugger waits for the debuggee to 
send a DONE command, which it can't because it is suspended.

After disabling the ThreadDeathRequest, the debuggee needs to make sure all 
pending events get processed.

Tested by running thread001 about 600 times with JTREG_USAGE_TRACKER=true

---------
- [x] I confirm that I make this contribution in accordance with the [OpenJDK 
Interim AI Policy](https://openjdk.org/legal/ai).

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

Commit messages:
 - Fix test exit issue due to unexpected ThreadDeath event

Changes: https://git.openjdk.org/jdk/pull/31156/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=31156&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8330363
  Stats: 13 lines in 1 file changed: 12 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/31156.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/31156/head:pull/31156

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

Reply via email to