RFR(S): 8248910: NPE when freeing the memory for a slice from a buffer
Yangfei (Felix)
felix.yang at huawei.com
Mon Aug 3 01:46:49 UTC 2020
Hi,
Bug: https://bugs.openjdk.java.net/browse/JDK-8248910
Webrev: http://cr.openjdk.java.net/~fyang/8248910/webrev.00
As commented on the bug, initially we observed this issue when we use Randoop which is a unit test generator for Java.
The overall procedure is described by the newly add test.
For a slice from a ByteBuffer, it does not have a cleaner, which leads to the NPE.
Here, I think we should not try to free the memory of a slice.
Proposed fix adds a null check for cleaner in Util.free before invoking its clean() method.
Tier1-3 tested on x86_64-linux-gnu. Newly add test fail without the fix and pass otherwise.
Comments?
Thanks,
Felix
More information about the nio-dev
mailing list