RFR: 8140241: (fc) Data transfer from FileChannel to itself causes hang in case of overlap
Brian Burkhalter
bpb at openjdk.java.net
Tue Aug 10 17:18:15 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.
Fixed the overlap checks and the transferFrom n == 0 case. The scenario is unlikely but if it occurs the consequences are serious. I am trying to find out about the Apple bug (actually 2586576 as the one I filed, 37764443, was marked a duplicate).
As an aside, I think that the cast to `int` at line 689 of `FileChannelImpl` should have been removed in the fix for [JDK-8271308](https://bugs.openjdk.java.net/browse/JDK-8271308) but was not.
-------------
PR: https://git.openjdk.java.net/jdk/pull/5061
More information about the nio-dev
mailing list