RFR: 8272047: java/nio/channels/FileChannel/Transfer2GPlus.java failed with Unexpected transfer size: 2147418112
Brian Burkhalter
bpb at openjdk.java.net
Thu Aug 5 23:12:40 UTC 2021
On Thu, 5 Aug 2021 23:00:58 GMT, Naoto Sato <naoto at openjdk.org> wrote:
>> Please consider this fix which resolves a test consistently failing on aarch64 in the CI pipeline.
>
> test/jdk/java/nio/channels/FileChannel/Transfer2GPlus.java line 100:
>
>> 98: break;
>> 99: total += n;
>> 100: } while (total < LENGTH);
>
> Could it be possible where the `total` is larger than `LINUX_MAX_TRANSFER_SIZE` here after the loop? If so, the test below only checks whether the `dstCh` is smaller than `LENGTH` and proceeds without the error reported.
On Linux the `transferTo()` method uses `sendfile()` for the code in question. The specification of [sendfile()](https://man7.org/linux/man-pages/man2/sendfile.2.html) states that it will transfer at most `0x7ffff000` (`LINUX_MAX_TRANSFER_SIZE`) bytes. So here we are only checking for an aberration which is not essential to the test. The important content is when `transferTo()` is supposed to actually copy the full length in one shot. This Linux part of the test is just a drive-by sanity check.
-------------
PR: https://git.openjdk.java.net/jdk/pull/5025
More information about the nio-dev
mailing list