[8u] [RFR] Request for Review of Backport of JDK-8179887: Build failure with glibc >= 2.24: error: 'int readdir_r(DIR*, dirent*, dirent**)' is deprecated

B. Blaser bsrbnd at gmail.com
Mon Jul 9 16:59:36 UTC 2018

On 9 July 2018 at 17:01, Andrew Hughes <gnu.andrew at redhat.com> wrote:
> On 9 July 2018 at 01:35, David Holmes <david.holmes at oracle.com> wrote:
> snip...
>>> Note that I also provided a variant of the fix only in 'os::readdir'
>>> which shouldn't break JFR:
>>> https://bugs.openjdk.java.net/secure/attachment/76645/os_readdir2.patch
>>> Maybe this could make it for 8u?
>> This is linux specific code but it seems to be using internal knowledge of
>> how a struct dirent is laid out on Linux. I'd also have to ensure this gets
>> tested with JFR on 8u.
>> I'll leave it to Andrew to decide on the above fix, or the makefile warning
>> fix. I'll Review whichever is chosen.
>> Thanks,
>> David
>>> Bernard
> It's difficult for me to really just on Bernand's patch as I don't
> know what problem
> we're trying to solve. At the very least, it needs to be documented why that
> memory copy is taking place.

I think the problem is important since it's still present in 11 & 12
and should probably be solved, see:


Unfortunately, the current fix:




alters 'os::readdir' behavior because the 'dbuf' parameter isn't used
anymore which breaks some callers that are expecting it to be filled,
for example:


The following test reveals the problem:


This probably means that 11 & 12 would have to be fixed with either:




I guess the second one is an easier patch for 8 as it doesn't imply
JFR to be fixed (which was closed in 8, I think?).
Both patches I suggested for 11 are passing tier1 + the failing

So, we can disable the warning for 8 but the process iterator will
still remain broken in 11 & 12.

What should we do?


> I can propose a variant of the warning fix, but I think it has to involve moving
> the readdir function out of os_linux.inline.hpp and into os_linux.cpp so the
> warning pragmas can be safely applied.
> --
> Andrew :)
> Senior Free Java Software Engineer
> Red Hat, Inc. (http://www.redhat.com)
> Web Site: http://fuseyism.com
> Twitter: https://twitter.com/gnu_andrew_java
> PGP Key: ed25519/0xCFDA0F9B35964222 (hkp://keys.gnupg.net)
> Fingerprint = 5132 579D D154 0ED2 3E04  C5A0 CFDA 0F9B 3596 4222

More information about the hotspot-dev mailing list