Bug #11353
closed
ASYNC BUG after failure of Process.exec when closing FD 3 (or 4 or 5)
Added by ngoto (Naohisa Goto) over 9 years ago.
Updated over 9 years ago.
Description
The following shows ASYNC BUG.
ruby -e 'Process.exec("/does_not_exist", "arg", {3=>:close})'
[ASYNC BUG] -e:1:in `exec': No such file or directory - /does_not_exist (Errno::ENOENT)
from -e:1:in `<main>'
consume_communication_pipe: read
EBADF
ruby 2.3.0dev (2015-07-10) [x86_64-linux]
[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html
Aborted
Closing FD 4 or 5 also causes ASYNC BUG.
- Related to Bug #11350: When Process.exec failed, redirections were still changed and not restored added
- Related to Bug #11336: TestProcess#test_exec_fd_3_redirect failed on Solaris 10 added
- Status changed from Open to Closed
Applied in changeset r51255.
-
process.c (redirect_close, parent_redirect_close): should not close
reserved FD. It should be closed in the exec system call due to the
O_CLOEXEC or FD_CLOEXEC flag. [Bug #11353] [ruby-core:69977]
-
process.c (close_unless_reserved): new function to close FD unless
it is reserved for internal communication.
-
thread_pthread.c (rb_reserved_fd_p): should check owner_process pid
to avoid false positive in forked child process.
Also available in: Atom
PDF
Like0
Like0Like0Like0