Project

General

Profile

Actions

Bug #9122

closed

requiring readline in a spawned ruby process with new process group can hang it

Added by gnufied (hemant kumar) about 11 years ago. Updated over 5 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
2.0.0-p247
Backport:
[ruby-core:58398]

Description

Lets say I have a program:

~> cat a.rb
require "pty"
require "io/console"
puts "Starting"

m, s = PTY.open
s.raw! # disable newline conversion.

pid = spawn("ruby using_pry.rb", chdir: '.', pgroup: true, out: m, err: m)
at_exit { Process.kill("TERM", pid)}
Process.wait(pid)

and

~> cat b.rb
require "readline"

loop do
puts "Hello"
sleep(5)
end

If I run a.rb, spawned process gets hung at requiring readline. However if I close the stdin in spawned process via in: :close this problem does not occur. It also does not happen if I am not reassinging STDOUT of spawned process as currently I do.

Updated by nagachika (Tomoyuki Chikanaga) almost 11 years ago

  • Status changed from Open to Feedback

I cannot reproduce on Mac OS X 10.9 (Mavericks).
What's your environment. Please check if it is reproducible with 2.0.0-p353 and trunk?

Actions #2

Updated by jeremyevans0 (Jeremy Evans) over 5 years ago

  • Status changed from Feedback to Closed
  • Backport deleted (1.9.3: UNKNOWN, 2.0.0: UNKNOWN)
Actions

Also available in: Atom PDF

Like0
Like0Like0