Spakman / urchin

A Unix shell for Ruby programmers.
http://spakman.github.com/urchin/
GNU General Public License v3.0
36 stars 1 forks source link

Don't close Ruby reserved FDs in forked processes #20

Closed Spakman closed 11 years ago

Spakman commented 11 years ago

Since MRI 1.9, a pipe has been used for internal signalling communication. A C API, rb_reserved_fd_p(), has been provided to check if a file descriptor is used by the VM or not.

Currently, Urchin closes all FDs > 2. For some reason, I haven't found this to be a problem under 1.9, but testing with Ruby 2.0.0-dev does give intermittent problems:

[ASYNC BUG] thread_timer: select
EBADF

ruby 2.0.0dev (2012-11-01 trunk 37411) [x86_64-linux]

Urchin should use the C API, either with a C extension or using FFI.

Spakman commented 11 years ago

This was fixed in 972f27d409dbb0204ba19102370bf8a9de66fca0.