-
-
Notifications
You must be signed in to change notification settings - Fork 942
Closed
Milestone
Description
The issue was originally reported in #5709 and successfully fixed in JRuby 9.2.8. However, the regression was introduced in JRuby 9.3 and is still present in JRuby 9.4.
I cannot reopen original bug - hence new issue.
Environment Information
Provide at least:
- JRuby 9.4.0.0
- macOS 13 arm64
Other relevant info you may wish to add:
- Installed or activated gems
- Application/framework version (e.g. Rails, Sinatra)
- Environment variables
Expected Behavior
Run the following script:
require 'socket'
sock = Socket.new(Socket::AF_INET, Socket::SOCK_STREAM)
addr = Socket.pack_sockaddr_in(9250, '127.0.0.1')
begin
sock.connect_nonblock(addr)
rescue Errno::EINPROGRESS
IO.select(nil, [sock], nil, 1) # select socket for writing
sock.getsockopt(Socket::SOL_SOCKET, Socket::SO_ERROR) # read any errors from last connection
retry
rescue Errno::ECONNREFUSED, Errno::EINVAL
puts 'Open!'
end
sock.closeThis code works fine on MRI 3.0:
$ ruby socket.rb
Open!
Actual Behavior
The same code fails on JRuby 9.4:
$ ruby socket.rb
Open!
Errno::EBADF: Bad file descriptor - No message available
Unable to find org/jruby/ext/socket/RubySocket.java to read failed line
<main> at socket.rb:16
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels