"bad file descriptor" in a call to console_size
Open
Nobody has claimed this yet.
Windows
- Dominant language
- Ruby
- Stars
- 930
- Forks
- 465
- Avg merge
- 3d 10h
- Merged PRs (30d)
- 27
Description
in Windows, Ruby 1.9.3, RDoc 4.2.0, with this example input file, focusgroup.rb:
require 'focusgroup/pipeline'
require 'focusgroup/serviceversion'
running rdoc --debug focusgroup.rb produces:
Before reporting this, could you check that the file you're documenting
has proper syntax:
c:/Ruby193/bin/ruby.exe -c focusgroup.rb
RDoc is not a full Ruby parser and will fail when fed invalid ruby programs.
The internal error was:
(Errno::EBADF) Bad file descriptor
c:/Ruby193/lib/ruby/1.9.1/io/console/size.rb:16:in `winsize'
c:/Ruby193/lib/ruby/1.9.1/io/console/size.rb:16:in `console_size'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rdoc-4.2.0/lib/rdoc/stats/normal.rb:29:in `print_file'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rdoc-4.2.0/lib/rdoc/stats.rb:81:in `add_file'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rdoc-4.2.0/lib/rdoc/rdoc.rb:347:in `parse_file'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rdoc-4.2.0/lib/rdoc/rdoc.rb:421:in `block in parse_files'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rdoc-4.2.0/lib/rdoc/rdoc.rb:419:in `map'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rdoc-4.2.0/lib/rdoc/rdoc.rb:419:in `parse_files'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rdoc-4.2.0/lib/rdoc/rdoc.rb:489:in `document'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rdoc-4.2.0/bin/rdoc:20:in `<top (required)>'
c:/Ruby193/bin/rdoc:23:in `load'
c:/Ruby193/bin/rdoc:23:in `<main>'
Bad file descriptor
c:/Ruby193/lib/ruby/1.9.1/io/console/size.rb:16:in `winsize'
c:/Ruby193/lib/ruby/1.9.1/io/console/size.rb:16:in `console_size'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rdoc-4.2.0/lib/rdoc/stats/normal.rb:29:in `print_file'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rdoc-4.2.0/lib/rdoc/stats.rb:81:in `add_file'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rdoc-4.2.0/lib/rdoc/rdoc.rb:347:in `parse_file'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rdoc-4.2.0/lib/rdoc/rdoc.rb:421:in `block in parse_files'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rdoc-4.2.0/lib/rdoc/rdoc.rb:419:in `map'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rdoc-4.2.0/lib/rdoc/rdoc.rb:419:in `parse_files'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rdoc-4.2.0/lib/rdoc/rdoc.rb:489:in `document'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rdoc-4.2.0/bin/rdoc:20:in `<top (required)>'
c:/Ruby193/bin/rdoc:23:in `load'
c:/Ruby193/bin/rdoc:23:in `<main>'
c:/Ruby193/bin/ruby.exe -c focusgroup.rb produces:
Syntax OK
Contributor guide
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 in lib/rdoc/stats/normal.rb at the print_file call to console_size, then compare it with the failing winsize call in Ruby's io/console/size.rb. Reproduce with the supplied focusgroup.rb input and verify that rdoc --debug completes without the Errno::EBADF error while the input remains syntax-valid.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100