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 unusable because of fcntl error #5004

byteit101 opened this Issue Jan 24, 2018 · 2 comments


None yet
2 participants

byteit101 commented Jan 24, 2018


  • jruby (2.3.3) 2017-12-07 929fde8 OpenJDK 64-Bit Server VM 25.151-b12 on 1.8.0_151-b12 +jit [linux-x86_64]
  • Multiple linuxes (RHELs & Debian)


2.3.0 :001 > require 'pty'
 => true 
2.3.0 :002 >{|m,s|}
 => nil 

Actual Behavior

jruby- :001 > require 'pty'
 => true 
jruby- :002 >{|m,s|}
NotImplementedError: F_SETFL only supports O_NONBLOCK
	from org/jruby/ `fcntl'
	from /home/byteit101/.rvm/rubies/jruby- `hack_close_on_exec'
	from /home/byteit101/.rvm/rubies/jruby- `block in open'
	from org/jruby/ `each'
	from /home/byteit101/.rvm/rubies/jruby- `open'
	from (irb):2:in `<eval>'
	from org/jruby/ `eval'
	from org/jruby/ `loop'
	from org/jruby/ `catch'
	from org/jruby/ `catch'
	from /home/byteit101/.rvm/rubies/jruby- `<main>'


This comment has been minimized.


headius commented Jan 24, 2018

Fallout from adding CLOEXEC support; now it is defined so code runs that didn't before, but not all paths have been fixed to support it.

headius added a commit that referenced this issue Jan 24, 2018

Fix PTY by being more permissive of fcntl flags. Fixes #5004.
Note that this logic is still wrong when attempting to clear flags
since it only looks for them to be set. We should mimic CRuby's
fcntl logic when we have access to a real file descriptor, and
use the current logic (with fixes for clearing flags) as a
fallback only.

@headius headius added this to the JRuby milestone Jan 24, 2018


This comment has been minimized.


headius commented Jan 24, 2018

Fixed for 9.1.16 by softening the restrictions on fcntl flags. The logic in there is not correct yet, since it doesn't clear flags and only sets specific ones (NONBLOCK and CLOEXEC) but it works properly again (and is no worse than before).

@headius headius closed this Jan 24, 2018

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