Project

General

Profile

Bug #14505

IO.popen / Open3.popen2 / backtick subprocess remains blocked

Added by lionel_perrin (Lionel PERRIN) over 1 year ago. Updated about 14 hours ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]
[ruby-core:85729]

Description

The following ruby code never returns

`ruby -r oci8 -e puts 'hello'`
IO.popen(%w(ruby -r oci8 -e)+["puts 'hello'"]) { |o| puts o.read } # this never returns too
Open3.capture2(*%w(ruby -r oci8 -e)+["puts 'hello'"]) # and this is blocked too

while its python equivalent runs successfully

import subprocess
subprocess.call(['ruby', '-r', 'oci8', '-e', 'puts "hello"'])

The issue seems to require some 'unusual' context to be triggered. The ruby-oci8 (https://github.com/kubo/ruby-oci8) gem used by the subprocess loads an oracle dll which seems to open some file descriptors. Anyway, I wouldn't expect the caller to be affected by the libraries loaded by the subprocesses.

I've reproduced the problem with ruby 2.5.0p0 (2017-12-25 revision 61468) x86_64-linux

Thanks for your help,

Lionel

History

#1

Updated by lionel_perrin (Lionel PERRIN) over 1 year ago

  • Description updated (diff)
#2

Updated by lionel_perrin (Lionel PERRIN) over 1 year ago

  • Description updated (diff)
#3

Updated by lionel_perrin (Lionel PERRIN) over 1 year ago

  • Description updated (diff)

Updated by nobu (Nobuyoshi Nakada) over 1 year ago

  • Status changed from Open to Feedback

That python code isn't equivalent, as it does not capture the output.
Does system("ruby", "-r", "oci8", "-e", "puts 'hello'") block too?

#5

Updated by jeremyevans0 (Jeremy Evans) about 14 hours ago

  • Status changed from Feedback to Closed

Also available in: Atom PDF