jdk8u-dev Digest, Vol 90, Issue 20

Andrew Hughes gnu.andrew at redhat.com
Wed May 26 01:33:53 UTC 2021


On 16:39 Sun 16 May     , Andrew Haley wrote:
> On 5/15/21 5:14 PM, Kate Fox wrote:
> > Here is the code from UnixNativeDispatcher.c:
> > 
> > JNIEXPORT jbyteArray JNICALL
> > Java_sun_nio_fs_UnixNativeDispatcher_readdir(JNIEnv* env, jclass this, jlong value) {
> > ...
> >     res = readdir64_r(dirp, ptr, &result);
> 
> Ah, right. This is about readdir64_r().
> 
> This is Bug 8207340: (fs) UnixNativeDispatcher close and readdir usages should be fixed.
> It has not been backported to 8u, and as far as I can see there is no proposal that it
> should be, either by OpenJDK or Oracle.
> 
> I don't know why this one didn't get backported. The patch looks quite straightforward.
> There may be some issues with old operating systems that affect this, but given that
> HotSpot is using the new readdir() I doubt that this would hurt. We are very cautious
> when backporting to 8, which is rather elderly.
> 
> We could just put this patch in our queue, but it might help if you tried applying it
> and got back to us.
> 
> -- 
> Andrew Haley  (he/him)
> Java Platform Lead Engineer
> Red Hat UK Ltd. <https://www.redhat.com>
> https://keybase.io/andrewhaley
> EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671
> 

There are actually four issues in total:

JDK-8202353: os::readdir should use readdir instead of readdir_r [0] (in 8u)
JDK-8202794: Native Unix code should use readdir rather than readdir_r [1]
JDK-8207340: (fs) UnixNativeDispatcher close and readdir usages should be fixed [2]
JDK-8207748: Fix for 8202794 breaks tier1 builds [3]

The reason only the first of these was backported to 8u is actually quite simple;
only the HotSpot code is built with -Werror, so only there does the deprecated warning
from the use of readdir_r cause a build failure. It's present in my 8u build logs
for the JDK code, but there, it is non-fatal.

If there are other reasons to switch to readdir, then I can look into backporting
the remaining fixes. There has been no motivation to do so thus far, because it
was believed only to trigger a deprecation warning (and indeed, we initially only
muted the HotSpot one as well).

[0] https://bugs.openjdk.java.net/browse/JDK-8202353
[1] https://bugs.openjdk.java.net/browse/JDK-8202794
[2] https://bugs.openjdk.java.net/browse/JDK-8207340
[3] https://bugs.openjdk.java.net/browse/JDK-8207748

Thanks,
-- 
Andrew :)

Senior Free Java Software Engineer
OpenJDK Package Owner
Red Hat, Inc. (http://www.redhat.com)

PGP Key: ed25519/0xCFDA0F9B35964222 (hkp://keys.gnupg.net)
Fingerprint = 5132 579D D154 0ED2 3E04  C5A0 CFDA 0F9B 3596 4222


More information about the jdk8u-dev mailing list