[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
Fri Jul 6 01:31:05 UTC 2018

On 6/07/2018 6:05 AM, Andrew Hughes wrote:
> On 5 July 2018 at 05:03, David Holmes <david.holmes at oracle.com> wrote:
>> Hi Andrew,
>> As far as I can see this got quite messy. We initially disabled the warning
>> to fix the build problem. Then we actually changed the code in 8179887. But
>> that broke JFR's use of the API:
>> https://bugs.openjdk.java.net/browse/JDK-8202835
> Yes, I saw this just before posting the backport, but couldn't figure out how/if
> it related to 8u. There is no JFR in OpenJDK 8u, is there? Certainly,
> I don't see
> the os_perf_linux.cpp file in Bernard's proposed patch in 8u. Maybe you could
> shed some light on this.

There's no JFR in the open in 8u, but I would expect this to still cause 
the same problem for Oracle's 8u JDK.

>> and that and:
>> https://bugs.openjdk.java.net/browse/JDK-8202794
>> remain open and unresolved.
> The JDK side doesn't cause the same problems as the HotSpot side because
> it isn't built with -Werror. Currently, I can't build 8u on a system
> with a recent
> glibc without patching out the readdir_r usage in some way. As you may
> guess, it's becoming a bit of a pain. So there's not the same need to
> backport this to 8u.
> That said, is there a reason the patch hasn't made it into the mainline yet?
> I couldn't see any follow-on in the mailing list archive.

I can't answer that sorry. I was simply pointing out this this may not 
be as clean and simple as suggested. I certainly couldn't add my review 
to it for 8u as it remains unclear to me whether the fix is suitable.

>> I'd be inclined to disable the build warning for 8u rather than make code
>> changes (which will likely still break JFR).
> This was my first inclination - and it's what we went with for OpenJDK
> 7 [0] [1] -
> but it brings its own problems. The way it was disabled at first uses inline
> pragmas that don't work with older versions of GCC that are used to build
> 8. Moving the pragma outside the function is problematic because this is an
> inline header file.

It's never easy is it. :(


>> David
> [0] http://hg.openjdk.java.net/jdk7u/jdk7u/hotspot/rev/66e04addced6
> [1] http://hg.openjdk.java.net/jdk7u/jdk7u/hotspot/rev/819d329e1fd0

More information about the hotspot-dev mailing list