RFR 8203174: [Graal] JDI tests fail with Unexpected exception: com.sun.jdi.ObjectCollectedException
Daniil Titov
daniil.x.titov at oracle.com
Sat Jun 23 02:13:46 UTC 2018
Please review the changes that fix 15 tests failures when running with Graal.
The main problem here is that the tests assume that no garbage collection happens before the tests complete their checks. The other problem is that the tests could not strictly distinguish the objects created by the debuggee on the request from the test from the objects of the same class created by the debuggee VM on its own. In case when java.lang.String or arrays of primitives are used in the tests the number of objects the test operates could significantly exceeds the number of the objects the test actually created and iterating over all of them results in the timeout.
The fix ensures that the object references created in the tests are protected from garbage collection or modifies the test to expect an ObjectCollectedException where necessary. In some cases, the fix ensures that only the main thread of the debuggee is running to prevent the garbage collector thread to create objects of the same class the test is working with and avoid timeouts.
Webrev: http://cr.openjdk.java.net/~dtitov/8203174/webrev.01
Bug: https://bugs.openjdk.java.net/browse/JDK-8203174
Thanks,
Daniil
More information about the serviceability-dev
mailing list