-
Enhancement
-
Resolution: Fixed
-
P4
-
11
-
b03
-
generic
-
generic
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8225520 | 11.0.5-oracle | Kim Barrett | P4 | Resolved | Fixed | b01 |
JDK-8221874 | 11.0.4 | Kim Barrett | P4 | Resolved | Fixed | b01 |
JDK-8226245 | openjdk8u232 | Andrew Hughes | P4 | Resolved | Fixed | b01 |
Linux platforms should use readdir because glibc (>= 2.24) deprecated readdir_r; see
AIX documentation is clear that readdir has the desired reentrancy:
https://www.ibm.com/support/knowledgecenter/en/ssw_aix_71/com.ibm.aix.basetrf2/readdir_r.htm
The readdir subroutine is reentrant when an application program uses different DirectoryPointer parameter values (returned from the opendir subroutine). Use the readdir_r subroutine when multiple threads use the same directory pointer.
Solaris documentation is clear that readdir has the desired reentrancy:
https://docs.oracle.com/cd/E36784_01/html/E36874/readdir-r-3c.html
It is safe to use readdir() in a threaded application, so long as only one thread reads from the directory stream at any given time. The readdir() function is generally preferred over the readdir_r() function.
Windows os::readdir uses a Windows-specific mechanism, and ignores the dirent* second argument that is needed for readdir_r support.
I haven't figured out the state of things on MacOS. None of the various BSD-variant documentation I've looked at even mention a thread-safety problem for readdir.
There is some discussion of possible POSIX deprecation of readdir_r here:
http://austingroupbugs.net/view.php?id=696
- backported by
-
JDK-8221874 os::readdir should use readdir instead of readdir_r
- Resolved
-
JDK-8225520 os::readdir should use readdir instead of readdir_r
- Resolved
-
JDK-8226245 os::readdir should use readdir instead of readdir_r
- Resolved
- duplicates
-
JDK-8212041 JDK11u build failure
- Closed
- relates to
-
JDK-8202835 jfr/event/os/TestSystemProcess.java fails on missing events
- Resolved
-
JDK-8166372 Improve readdir_r buffer handling in TimeZone_md.c
- Closed
-
JDK-8134540 Much nearly duplicated code for PerfMemory support
- Resolved
-
JDK-8179887 Build failure with glibc >= 2.24: error: 'int readdir_r(DIR*, dirent*, dirent**)' is deprecated
- Resolved
-
JDK-8202794 Native Unix code should use readdir rather than readdir_r
- Closed
-
JDK-8212041 JDK11u build failure
- Closed