[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


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 ]

JDK 9 code review thread:

JDK 9 changset:

bug report (minor regression fix added to above fix):
[ (ch) linux io_util_md: Operation not supported exception after 8168628 ]

JDK 9 code review thread (December 2016 and January 2017):

JDK 9 changset:

webrev combining above two fixes for review:

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).


More information about the nio-dev mailing list