New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sysread hangs on EOF on mac #5287

Open
andrewdotn opened this Issue Aug 21, 2018 · 0 comments

Comments

Projects
None yet
2 participants
@andrewdotn

andrewdotn commented Aug 21, 2018

Environment

Provide at least:

  • JRuby version (jruby -v) and command line (flags, JRUBY_OPTS, etc)
    jruby 9.2.0.0 (2.5.0) 2018-05-24 81156a8 Java HotSpot(TM) 64-Bit Server VM 25.161-b12 on 1.8.0_161-b12 +jit [darwin-x86_64]
  • Operating system and platform (e.g. uname -a)
    Darwin localhost 17.7.0 Darwin Kernel Version 17.7.0: Thu Jun 21 22:53:14 PDT 2018; root:xnu-4570.71.2~1/RELEASE_X86_64 x86_64

Expected Behavior

With this script, I expect to see EOFError raised:

f = File.open('/etc/passwd', 'r')
loop do
  x = f.sysread(1024)
  puts "read #{x.length}"
end

This is what MRI ruby does, as well as JRuby 9.1.15.0 and earlier.

Actual Behavior

The script hangs at EOF with JRuby 9.2.0.0 on the mac. The Java debugger shows it’s inside RubyThread.select() calling Selector.select(). Linux seems to be unaffected.

git bisect traces it to dad9ab0, which was cherry-picked as 3493a91, so 9.1.16.0 and 9.1.17.0 are affected as well.

@enebo enebo added this to the JRuby 9.2.1.0 milestone Aug 22, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment