[#102393] [Ruby master Feature#17608] Compact and sum in one step — sawadatsuyoshi@...

Issue #17608 has been reported by sawa (Tsuyoshi Sawada).

13 messages 2021/02/04

[#102438] [Ruby master Bug#17619] if false foo=42; end creates a foo local variable set to nil — pkmuldoon@...

Issue #17619 has been reported by pkmuldoon (Phil Muldoon).

10 messages 2021/02/10

[#102631] [Ruby master Feature#17660] Expose information about which basic methods have been redefined — tenderlove@...

Issue #17660 has been reported by tenderlovemaking (Aaron Patterson).

9 messages 2021/02/27

[#102639] [Ruby master Misc#17662] The herdoc pattern used in tests does not syntax highlight correctly in many editors — eregontp@...

Issue #17662 has been reported by Eregon (Benoit Daloze).

13 messages 2021/02/27

[#102652] [Ruby master Bug#17664] Behavior of sockets changed in Ruby 3.0 to non-blocking — ciconia@...

Issue #17664 has been reported by ciconia (Sharon Rosner).

23 messages 2021/02/28

[ruby-core:102555] [Ruby master Bug#17561] The timeout option for Addrinfo.getaddrinfo is not reliable on Ruby 2.7.2

From: stanhu@...
Date: 2021-02-17 08:51:09 UTC
List: ruby-core #102555
Issue #17561 has been updated by stanhu (Stan Hu).


I agree that this should be removed from Ruby 2.7. In https://gitlab.com/gitlab-org/gitlab/-/issues/11951#note_510756578, we were able to trigger a seg fault by doing this:

```ruby
require 'socket'

loop do
  Addrinfo.getaddrinfo('localhost', nil, timeout: 0)
rescue SocketError
end
```

----------------------------------------
Bug #17561: The timeout option for Addrinfo.getaddrinfo is not reliable on Ruby 2.7.2
https://bugs.ruby-lang.org/issues/17561#change-90457

* Author: smcgivern (Sean McGivern)
* Status: Open
* Priority: Normal
* ruby -v: 2.7.2
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
#15553 introduced a timeout option for Addrinfo.getaddrinfo, which uses getaddrinfo_a internally. It appears this has since been reverted in the development branch via https://github.com/ruby/ruby/commit/5d8bcc4870601ab1ee05346346f241d4a805aac9 (due to #17220 maybe; I didn't quite follow the discussion).

However, Ruby 2.7.2 is still not reliable, even without forking:

```
$ ruby -v
ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-linux]
$ ruby -e "require 'resolv'; 10000.times { |i| p [i, Addrinfo.getaddrinfo('2130706433', 80, nil, :STREAM, timeout: 5)] }" | tail
Traceback (most recent call last):
	3: from -e:1:in `<main>'
	2: from -e:1:in `times'
	1: from -e:1:in `block in <main>'
-e:1:in `getaddrinfo': getaddrinfo_a: All requests done (SocketError)
[1473, [#<Addrinfo: 127.0.0.1:80 TCP (2130706433)>]]
[1474, [#<Addrinfo: 127.0.0.1:80 TCP (2130706433)>]]
[1475, [#<Addrinfo: 127.0.0.1:80 TCP (2130706433)>]]
[1476, [#<Addrinfo: 127.0.0.1:80 TCP (2130706433)>]]
[1477, [#<Addrinfo: 127.0.0.1:80 TCP (2130706433)>]]
[1478, [#<Addrinfo: 127.0.0.1:80 TCP (2130706433)>]]
[1479, [#<Addrinfo: 127.0.0.1:80 TCP (2130706433)>]]
[1480, [#<Addrinfo: 127.0.0.1:80 TCP (2130706433)>]]
[1481, [#<Addrinfo: 127.0.0.1:80 TCP (2130706433)>]]
[1482, [#<Addrinfo: 127.0.0.1:80 TCP (2130706433)>]]
```

This is on a VirtualBox VM and fails fairly quickly. On a 'real' Linux system, I need to try a few times or bump the number of iterations, but it also fails consistently with consecutive requests. I'm choosing 2130706433 (the decimal representation of 127.0.0.1) as that's what our test suite uses, and that's what failed when I tried to use the timeout option.

On Ruby 3.0.0-dev this does not fail due to the aforementioned revert, but should this also be removed from Ruby 2.7 until it's ready?



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread