Integrated: 8284043: com/sun/jdi/MethodInvokeWithTraceOnTest.java failing with com.sun.jdi.ObjectCollectedException

Chris Plummer cjplummer at openjdk.java.net
Thu Apr 7 19:05:41 UTC 2022


On Thu, 31 Mar 2022 04:09:55 GMT, Chris Plummer <cjplummer at openjdk.org> wrote:

> Test is getting an `com.sun.jdi.ObjectCollectedException` during an invoke. The reason is because an allocated object is not being prevented from being gc'd:
> 
> 
>          StringReference stringObj = vm().mirrorOf("test string");
>         ...
>         classType.invokeMethod(thread, printMethod, Collections.singletonList(stringObj), invokeOptions);
> 
> 
> Need a `disableCollection()` on `stringObj` since threads are resumed during the invoke, allowing it to be collected.

This pull request has now been integrated.

Changeset: e98c32d6
Author:    Chris Plummer <cjplummer at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/e98c32d6b6621f00b82089c8a92913234e6abe5c
Stats:     2 lines in 1 file changed: 1 ins; 0 del; 1 mod

8284043: com/sun/jdi/MethodInvokeWithTraceOnTest.java failing with com.sun.jdi.ObjectCollectedException

Reviewed-by: sspitsyn, amenkov

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

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


More information about the serviceability-dev mailing list