Skip to content

JRuby 9k-pre2 throws IOError when reading from $stdin #2959

@ghost

Description

When using a background thread that blocks until input is read via

$stdin.gets.chomp

the thread encounters an IOError, declaring that the handle is invalid. The error itself seems to be raised within RubyIO.java (line 2203), as shown in the logging output below:

Terminal started
term> Process #<Terminal:0x6a927603> encountered unhandled error: The handle is invalid (IOError)
   gets at org/jruby/RubyIO.java:2203
   read at /Users/petrilloj/Desktop/github/lagrange/lib/term.rb:48
  cycle at /Users/petrilloj/Desktop/github/lagrange/lib/term.rb:86
    run at /Users/petrilloj/Desktop/github/lagrange/lib/thread/process.rb:64
Terminal closed

Links to relevant code where this occurs can be found here:

For reference, the output from jruby -v produces (formatted for readability):

jruby 9.0.0.0.pre2 (2.2.2) 2015-04-28 2755ae0 Java HotSpot(TM) 
  64-Bit Server VM 25.31-b07 on 1.8.0_31-b13 +jit [Windows 7-amd64]

Note: this should be 1.8.0_45; I am away from my main development environment at the moment, but the problem persists on 1.8.0_31 as well.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions