RFR: 8140241: (fc) Data transfer from FileChannel to itself causes hang in case of overlap
Alan Bateman
alanb at openjdk.java.net
Tue Aug 10 09:09:30 UTC 2021
On Tue, 10 Aug 2021 01:21:21 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:
> This request proposes to fix a failure on macOS which occurs when transferring to or from a file channel from or to the same file channel when the source and destination intervals overlap.
This is logged with Apple as 37764443, it would be useful if we could get an update on that.
I'm not opposed to putting a workaround for this macOS bug but it does add clutter for scenario that may not arise too often. If we do put in a workaround then we'll probably need to restructure the overlap checks in both transferToTrustedChannel transferFromFileChannel to avoid overflow. Also transferFrom should check n >= 0 because 0 is a valid return.
-------------
PR: https://git.openjdk.java.net/jdk/pull/5061
More information about the nio-dev
mailing list