[8u] 8202353: os::readdir should use readdir instead of readdir_r
Hohensee, Paul
hohensee at amazon.com
Mon Jun 3 19:26:38 UTC 2019
Looks good.
Paul
On 5/31/19, 10:18 AM, "hotspot-dev on behalf of Andrew John Hughes" <hotspot-dev-bounces at openjdk.java.net on behalf of gnu.andrew at redhat.com> wrote:
Webrev: https://cr.openjdk.java.net/~andrew/openjdk8/8202353/webrev.01/
Bug: https://bugs.openjdk.java.net/browse/JDK-8202353
As came up again this week [0], 8u doesn't currently build with newer
versions of glibc >= 2.24 that deprecate readdir_r. There have been a
number of attempts to fix this upstream, some of which I've attempted to
backport to 8u in the past. 8202353 seems to be the most complete, so
I've backported this and propose it for review.
Differences from the 11u version:
* The AIX implementation of readdir_r is slightly different in 8u, as 8u
lacks JDK-8079125 ([aix] clean up Linux-specific code remnants in AIX
coding). As the function is being removed, the difference seems negligible.
* Changes to os_perf_aix.cpp, os_perf_linux.cpp, os_perf_solaris.cpp,
jfrRepository.cpp & ProblemList.txt are missing, because 8u currently
lacks JFR. These will need to be applied to the JFR tree separately.
* The readdir_r in Linux is different in 8u because it still actually
uses readdir_r, hence causing our problem. 11u already had JDK-8179887
(Build failure with glibc >= 2.24: error: 'int readdir_r(DIR*, dirent*,
dirent**)' is deprecated) before JDK-8202353 was applied.
* The readdir_r in Solaris is slightly more convoluted in 8u because it
doesn't contain JDK-8181787 (Remove Solaris SPARC GCC code). Again, this
is immaterial as the function is removed.
* There are some slight formatting differences in
src/hotspot/os/windows/os_windows.cpp. The 8u style is retained.
* The 8u version contains changes to src/share/vm/runtime/arguments.cpp
which are similar to those applied in the various perfMemory files. This
was necessary because 8u's arguments.cpp still uses readdir_r, while
these functions were removed in 11u as part of the removal of support
for endorsed JARs (JDK-8183238).
i've built the patched version on GNU/Linux and also checked the source
for remaining references to the removed readdir_buf_size. Testing on
other affected platforms (AIX, Windows, Solaris, *BSD) would be appreciated.
[0] https://mail.openjdk.java.net/pipermail/jdk8u-dev/2019-May/009477.html
--
Andrew :)
Senior Free Java Software Engineer
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
https://keybase.io/gnu_andrew
More information about the jdk8u-dev
mailing list