[8u] RFR(M): 8168628/8171452: (fc) SIGBUS when extending file size to map it
David Buck
david.buck at oracle.com
Fri Feb 2 14:16:49 UTC 2018
Hi!
I would really appreciate a review of my backport of jdk8168628 to JDK
8. As jdk8168628 introduced a regression (jdk8171452), I have also
included the small fix for that in my backport as it makes sense to push
them both at the same time.
bug report (original bug):
[ (fc) SIGBUS when extending file size to map it ]
https://bugs.openjdk.java.net/browse/JDK-8168628
JDK 9 code review thread:
http://mail.openjdk.java.net/pipermail/nio-dev/2016-December/003997.html
JDK 9 changset:
http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/c0af0f58d538
bug report (minor regression fix added to above fix):
[ (ch) linux io_util_md: Operation not supported exception after 8168628 ]
https://bugs.openjdk.java.net/browse/JDK-8171452
JDK 9 code review thread (December 2016 and January 2017):
http://mail.openjdk.java.net/pipermail/nio-dev/2016-December/004031.html
http://mail.openjdk.java.net/pipermail/nio-dev/2017-January/004048.html
JDK 9 changset:
http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/8b55846dd69d
webrev combining above two fixes for review:
http://cr.openjdk.java.net/~dbuck/8168628_jdk8_ver00/
The only non-trivial difference from the JDK 9 version of the fix is
that the glibc shipped with some older Linux distributions still
supported by JDK 8 (e.g. RHEL 5) do not have fallocate()/fallocate64().
Fortunately, they do have posix_fallocate(), which works fine for us
because we were passing the default mode flags to fallocate64() anyway.
The only complication is we need to define _FILE_OFFSET_BITS=64 to get
gcc to call posix_fallocate64() in the resulting object file. I
carefully examined both object files for any other changes as a result
of adding this define, and the only other difference is that the open()
of "/dev/null" at io_util_md.c:143 (see webrev) has been converted to an
open64() call, which is equivalent to adding O_LARGEFILE to the flags
parameter of open(), a very benign change given the code in question.
I have tested the backport extensively, including building all platforms
supported by JPRT for JDK 8, several runs of the "core" jprt testset,
and manually confirming the fix with the test case included in the
changeset itself (both with and without RAF).
Cheers,
-Buck
More information about the nio-dev
mailing list