On Tue, 9 Dec 2025 22:45:17 GMT, Chris Plummer <[email protected]> wrote:
> 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 This pull request has now been integrated. Changeset: 45ee89c4 Author: Chris Plummer <[email protected]> URL: https://git.openjdk.org/jdk/commit/45ee89c4c8e3d8bb418b8578fb361e7dc1c12be5 Stats: 9 lines in 1 file changed: 8 ins; 0 del; 1 mod 8373297: Test com/sun/jdi/AfterThreadDeathTest.java failed with unexpected ObjectCollectedException Reviewed-by: kevinw, sspitsyn, amenkov, lmesnik ------------- PR: https://git.openjdk.org/jdk/pull/28730
