VirtualBox

Opened 9 years ago

Closed 5 years ago

#15205 closed defect (obsolete)

libc: dir-posix.cpp:291:22: error: 'int readdir_r(DIR*, dirent*, dirent**)' is deprecated

Reported by: sergiomb Owned by:
Component: other Version: VirtualBox 5.0.16
Keywords: Cc:
Guest type: other Host type: other

Description (last modified by Frank Mehnert)

from https://sourceware.org/ml/libc-alpha/2016-02/msg00093.html

  • The readdir_r and readdir64_r functions are deprecated. It is recommended to use readdir and readdir64 instead.

it is more libc issue than GCC6 !?!

VirtualBox failed to compile here:

g++ -c -O2 -g -pipe -pedantic -Wshadow -Wshadow -Wall -Wextra -Wno-missing-field-initializers -Wno-unused -Wno-trigraphs -fdiagnostics-show-option -Wno-unused-parameter -Wlogical-op -Wno-long-long -Wno-long-long -Wno-delete-non-virtual-dtor -Wno-variadic-macros -O2 -mtune=generic -fno-omit-frame-pointer -fno-strict-aliasing -fvisibility=hidden -DVBOX_HAVE_VISIBILITY_HIDDEN -DRT_USE_VISIBILITY_DEFAULT -fvisibility-inlines-hidden  -Werror -m64 -I/builddir/build/BUILD/VirtualBox-5.0.16/src/VBox/Runtime/include -I/builddir/build/BUILD/VirtualBox-5.0.16/src/libs/liblzf-3.4 -I/builddir/build/BUILD/VirtualBox-5.0.16/src/libs/kStuff/kStuff/include -I/builddir/build/BUILD/VirtualBox-5.0.16/obj/obj/RuntimeR3/dtrace -I/usr/include/libxml2 -I/builddir/build/BUILD/VirtualBox-5.0.16/include -I/builddir/build/BUILD/VirtualBox-5.0.16/obj -DVBOX -DVBOX_OSE -DVBOX_WITH_64_BITS_GUESTS -DVBOX_WITH_DEBUGGER -DRT_OS_LINUX -D_FILE_OFFSET_BITS=64 -DRT_ARCH_AMD64 -D__AMD64__ -DVBOX_WITH_HARDENING -DRTPATH_APP_PRIVATE=\"/usr/lib64/virtualbox\" -DRTPATH_APP_PRIVATE_ARCH=\"/usr/lib64/virtualbox\" -DRTPATH_SHARED_LIBS=\"/usr/lib64/virtualbox\" -DRTPATH_APP_DOCS=\"/usr/lib64/virtualbox\" -D_REENTRANT -DIN_RT_STATIC -DIN_RT_R3 -DIN_SUP_STATIC -DIN_RING3 -DHC_ARCH_BITS=64 -DGC_ARCH_BITS=64 -DVBOX_WITH_DTRACE -DVBOX_WITH_DTRACE_R3 -DIN_RT_R3 -DIN_SUP_R3 -DLDR_WITH_NATIVE -DLDR_WITH_ELF32 -DLDR_WITH_PE -DRT_WITH_VBOX -DRT_NO_GIP -DRT_WITHOUT_NOCRT_WRAPPERS -DIPRT_WITH_OPENSSL -DLDR_WITH_KLDR -DRT_WITH_ICONV_CACHE -Wp,-MD,/builddir/build/BUILD/VirtualBox-5.0.16/obj/obj/RuntimeR3/r3/posix/dir-posix.o.dep -Wp,-MT,/builddir/build/BUILD/VirtualBox-5.0.16/obj/obj/RuntimeR3/r3/posix/dir-posix.o -Wp,-MP -o /builddir/build/BUILD/VirtualBox-5.0.16/obj/obj/RuntimeR3/r3/posix/dir-posix.o /builddir/build/BUILD/VirtualBox-5.0.16/src/VBox/Runtime/r3/posix/dir-posix.cpp
/builddir/build/BUILD/VirtualBox-5.0.16/src/VBox/Runtime/r3/posix/dir-posix.cpp: In function 'int rtDirReadMore(PRTDIR)':
/builddir/build/BUILD/VirtualBox-5.0.16/src/VBox/Runtime/r3/posix/dir-posix.cpp:291:22: error: 'int readdir_r(DIR*, dirent*, dirent**)' is deprecated [-Werror=deprecated-declarations]
             int rc = readdir_r(pDir->pDir, &pDir->Data, &pResult);
                      ^~~~~~~~~
In file included from /usr/include/features.h:368:0,
                 from /usr/include/errno.h:28,
                 from /builddir/build/BUILD/VirtualBox-5.0.16/src/VBox/Runtime/r3/posix/dir-posix.cpp:32:
/usr/include/dirent.h:189:12: note: declared here
 extern int __REDIRECT (readdir_r,
            ^
/builddir/build/BUILD/VirtualBox-5.0.16/src/VBox/Runtime/r3/posix/dir-posix.cpp:291:65: error: 'int readdir_r(DIR*, dirent*, dirent**)' is deprecated [-Werror=deprecated-declarations]
             int rc = readdir_r(pDir->pDir, &pDir->Data, &pResult);
                                                                 ^
In file included from /usr/include/features.h:368:0,
                 from /usr/include/errno.h:28,
                 from /builddir/build/BUILD/VirtualBox-5.0.16/src/VBox/Runtime/r3/posix/dir-posix.cpp:32:
/usr/include/dirent.h:189:12: note: declared here
 extern int __REDIRECT (readdir_r,
            ^
cc1plus: all warnings being treated as errors
kmk: *** [/builddir/build/BUILD/VirtualBox-5.0.16/obj/obj/RuntimeR3/r3/posix/dir-posix.o] Error 1

Attachments (1)

VirtualBox-5.0.16-glibc.patch (1.0 KB ) - added by sergiomb 8 years ago.
replace readdir_r with readdir

Download all attachments as: .zip

Change History (12)

comment:1 by Frank Mehnert, 9 years ago

Failed to compile: On which system?

comment:2 by Frank Mehnert, 9 years ago

Description: modified (diff)

comment:3 by Frank Mehnert, 9 years ago

I mean, I understood this is an upcoming change in the libc, but is this version already used on some system?

comment:4 by sergiomb, 9 years ago

yeah, sorry for the missing information , Fedora 24 branch , Fedora 24 pre-alfa version . Fedora 24 will have GCC6 and this glibc .

http://koji.fedoraproject.org/koji/packageinfo?packageID=57

should be: glibc-2.23.1-5.fc24

comment:5 by sergiomb, 9 years ago

Hello , I think this is solved in VirtualBox-5.0.17-105881.tar.bz2 Thanks

comment:6 by Frank Mehnert, 9 years ago

Actually I don't think so ...

comment:7 by sergiomb, 9 years ago

OK, so we have a new issue with VirtualBox-5.0.17-105881.tar.bz2 bug #15219

in reply to:  6 comment:8 by sergiomb, 9 years ago

Replying to frank:

Actually I don't think so ...

Mystery solved , this issue just happened with glibc-2.23.90-4.fc25 and not with glibc-2.23.1-5.fc24, So this need be fixed just for glibc-2.24, I guess.

by sergiomb, 8 years ago

replace readdir_r with readdir

comment:9 by sergiomb, 8 years ago

shut up gcc for complaining about readdir_r: https://www.virtualbox.org/changeset/63677/vbox/trunk why not fix it ?

comment:10 by Frank Mehnert, 8 years ago

What is the correct fix to be compatible with a new glibc as well as with older versions of glibc?

From 'man readdir_r': It is expected that a future version of POSIX.1 will make readdir_r() obsolete, and require that readdir() be thread-safe when concurrently employed on different directory streams.

So the official recommendation is to use readdir()/readdir64() on newer systems. VirtualBox can be still built on systems like EL5 which comes with glibc 2.5. Therefore we decided to stay with readdir_r() for the moment.

comment:11 by aeichner, 5 years ago

Resolution: obsolete
Status: newclosed
Note: See TracTickets for help on using tickets.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy