Skip to content

Avoid closing directory we're iterating #9546

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

ekohl
Copy link
Contributor

@ekohl ekohl commented Mar 5, 2025

Ruby 3.4 started error checking directory access and starts to raise Errno::EBADF.

This particular loop iterates on all open file descriptors and one is the directory listing from Dir.foreach.

In the past this could have led to leaked file descriptors, but it's unlikely since it's likely the last opened file descriptor and have the highest number.

Link: ruby/ruby@f2919bd
Link: https://bugzilla.redhat.com/show_bug.cgi?id=2349352

Ruby 3.4 started error checking directory access and starts to raise
Errno::EBADF.

This particular loop iterates on all open file descriptors and one is
the directory listing from Dir.foreach.

In the past this could have led to leaked file descriptors, but it's
unlikely since it's likely the last opened file descriptor and have the
highest number.

Link: ruby/ruby@f2919bd
Link: https://bugzilla.redhat.com/show_bug.cgi?id=2349352
@ekohl ekohl requested a review from a team as a code owner March 5, 2025 13:08
@puppetlabs-jenkins
Copy link
Collaborator

Can one of the admins verify this patch?

@akerl
Copy link
Contributor

akerl commented Jun 17, 2025

Is this still pending? hitting this on some of my servers and doesn't seem like there's a workaround?

@ekohl
Copy link
Contributor Author

ekohl commented Jun 17, 2025

I now consider Puppet closed source. Move to OpenVox where we actually fixed more Ruby 3.4 issues. See https://voxpupuli.org/blog/2025/06/14/an-unsupportable-path/ for more.

@ekohl ekohl closed this Jun 17, 2025
@ekohl ekohl deleted the fix-forking-on-ruby-3.4 branch June 17, 2025 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants