RFR: 8290848: LoadLibraryUnload.java still fails with "Too few cleared WeakReferences"

Jaikiran Pai jpai at openjdk.org
Wed Jul 27 06:45:51 UTC 2022


On Tue, 26 Jul 2022 21:44:19 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

> The intermittent test failure was due to the WeakReferences being unreferenced too early.
> Adding a Reference.reachabilityFence to the test makes it robust.
> 
> Remove from ProblemList-Xcomp.txt

Hello Roger, considering that the `wCanary` array will be "alive" at least till the end of the loop at line 126 (the loop within which we create the `WeakReference` instances and register them with the `refQueue`), shouldn't the `refQueue` be enqueued with these `WeakReference`s, even if `wCanary` gets unreferenced at line 126? Thus, shouldn't the `refQueue` have these unreferenced instances at line 169 - the place where we call `refQueue.remove(Utils.adjustTimeout(30 * 1000L));`?

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

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


More information about the core-libs-dev mailing list