[bug] find() breaks if a broken link is passed as argument
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 18
- Forks
- 9
- PR merge metrics
- No merged PRs in 30d
Description
Description
find() breaks if a broken link is passed as argument.
Version
ruby 3.3.5 (2024-09-03 revision ef084cc8f4)
Environment
Ruby container running on Apple Mac Book Pro M2
Reproducer
Create a broken link and pass it to find().
$ podman run --rm -d --name ruby-3.3-test docker.io/ruby:latest sleep infinity
8f3c2156fd77aca74ca45f5f1893c94522afc822d271c58c015eae0d4973b7f2
$ podman exec -it ruby-3.3-test bash
root@8f3c2156fd77:/# ln -s broken broken-link
root@8f3c2156fd77:/# irb
irb(main):036> require 'find'
irb(main):041* Find.find('broken-link') do |path|
irb(main):042* puts path
irb(main):043> end
/usr/local/lib/ruby/3.3.0/find.rb:45:in `block in find': No such file or directory - broken-link (Errno::ENOENT)
from /usr/local/lib/ruby/3.3.0/find.rb:45:in `collect!'
from /usr/local/lib/ruby/3.3.0/find.rb:45:in `find'
from (irb):41:in `<main>'
from <internal:kernel>:187:in `loop'
from /usr/local/lib/ruby/gems/3.3.0/gems/irb-1.13.1/exe/irb:9:in `<top (required)>'
from /usr/local/bin/irb:25:in `load'
from /usr/local/bin/irb:25:in `<main>'
Expected Behavior
The function should handle the exception cleanly.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the Find.find entry point and inspect find.rb around line 45, then reproduce the broken symlink case from the issue in the Ruby container. Trace how the missing path is handled and add coverage for the reported case; done means Find.find handles the broken link without the shown Errno::ENOENT failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100