Skip to content

"readdir_r" deprecated in newer glibc versions #1055

Closed

Description

@daveol

In fedora's rawhide version of glibc readdir_r is deprecated (build.log), the patch or bug don't really explain why or what to use else.

Activity

  1. added this to the 0.10.2 milestone on Mar 1, 2016
  2. peternewman commented on Mar 1, 2016

    @peternewman
    Member

    This seems like it might address why:
    https://womble.decadent.org.uk/readdir_r-advisory.html

    The patch explicitly says "It is recommended to use readdir and readdir64 instead."

  3. nomis52 commented on Mar 2, 2016

    @nomis52
    Member

    Switching to readdir() is a step backwards.

    I'd prefer that we use dirfd() to determine the size of the buffer for readdir_r().

    I've confirmed dirfd() is available on Mac & linux.

  4. daveol commented on Mar 2, 2016

    @daveol
    ContributorAuthor

    I'd prefer that we use dirfd() to determine the size of the buffer for readdir_r().

    Okay, but that doesn't take away that readdir_r() is deprecated in the newer versions of glibc and will probably be removed in the future.

    I see only one option, switching back to readdir()

  5. nomis52 commented on Mar 2, 2016

    @nomis52
    Member

    Hmm, ok I'm sold. I'll look at the patch later today..

  6. daveol commented on Mar 2, 2016

    @daveol
    ContributorAuthor

    The patch doesn't include thread handling at the moment (readdir is not threadsafe), which could be a problem if we use the function in two threads at the same time... do we?

  7. peternewman commented on Mar 9, 2016

    @peternewman
    Member

    Would it be worth using readdir_r where available (via configure) and only switching back to readdir on machines where the former has been deprecated, or is that overly complex?

  8. modified the milestones: 0.11.0, 0.10.2 on May 20, 2016
  9. peternewman commented on Sep 1, 2016

    @peternewman
    Member

    We're getting other users hitting this in the wild now http://text.michd.me/isiqejojof.mel . @loansindi .

  10. peternewman commented on Dec 7, 2016

    @peternewman
    Member
  11. daveol commented on Dec 10, 2016

    @daveol
    ContributorAuthor

    I now have written a different approach to a fix for this, it is however of very temporary nature. you can find that fix in PR #1167

  12. peternewman commented on Mar 5, 2017

    @peternewman
    Member

    @daveol put in a warnings skipping based fix as an interim workaround to this in #1168 . We'll still need to fix this properly for when readdir_r gets removed.

  13. kripton commented on May 8, 2020

    @kripton
    Member

    There's a pretty good explanation on http://man7.org/linux/man-pages/man3/readdir_r.3.html now.
    So I'd say that going back to readdir might not be a step backwards.

  14. added a commit that references this issue on May 17, 2020
    e0eb1b4
  15. added a commit that references this issue on Jun 13, 2020
    ecd3742
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions