[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

David Holmes david.holmes at oracle.com
Tue Jul 10 02:21:27 UTC 2018



On 10/07/2018 2:59 AM, B. Blaser wrote:
> 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:
> 
> https://bugs.openjdk.java.net/browse/JDK-8202835
> 
> Unfortunately, the current fix:
> 
> http://hg.openjdk.java.net/jdk/jdk/rev/746229cc1ab0
> 
> for:
> 
> https://bugs.openjdk.java.net/browse/JDK-8179887
> 
> 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:
> 
> http://hg.openjdk.java.net/jdk/jdk/file/0fad17c646c9/src/hotspot/os/linux/os_perf_linux.cpp#l905
> 
> The following test reveals the problem:
> 
> http://hg.openjdk.java.net/jdk/jdk/file/0fad17c646c9/test/jdk/jdk/jfr/event/os/TestSystemProcess.java
> 
> This probably means that 11 & 12 would have to be fixed with either:
> 
> http://mail.openjdk.java.net/pipermail/hotspot-dev/2018-May/032445.html
> 
> or:
> 
> https://bugs.openjdk.java.net/secure/attachment/76645/os_readdir2.patch
> 
> 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
> 'TestSystemProcess'.
> 
> So, we can disable the warning for 8 but the process iterator will
> still remain broken in 11 & 12.
> 
> What should we do?

The immediate issue in 8u is a build failure due to the warning. Fixing 
the warning, via compiler directives, addresses that. The other open 
bugs can deal with the problem of trying to switch to readdir.

Cheers,
David

> 
> Bernard
> 
> 
>> 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