The thread object for the main thread is getting unexpectedly collected. This results in an ObjectCollectedException during the test's handling of the ThreadDeath event. It tries enabling a SingleStepRequest on the thread, but the thread an already been collected by this time since the ThreadDeath event is using the SUSPEND_NONE policy, allowing the thread to exit.
This fix is to simply call ObjectReference.disableCollection() on the main thread. It will never be collected after this point. No need to ever call enableCollection(), because the debuggee is just going to exit anyway. Testing - Tier1 CI - Tier5 CI pruned to just run svc tests ------------- Commit messages: - prevent thread from getting collected Changes: https://git.openjdk.org/jdk/pull/28730/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28730&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8373297 Stats: 9 lines in 1 file changed: 8 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/28730.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28730/head:pull/28730 PR: https://git.openjdk.org/jdk/pull/28730
