[#108552] [Ruby master Bug#18782] Race conditions in autoload when loading the same feature with multiple threads. — "ioquatix (Samuel Williams)" <noreply@...>
Issue #18782 has been reported by ioquatix (Samuel Williams).
11 messages
2022/05/14
[ruby-core:108720] [Ruby master Bug#18769] StringIO#each hangs up on some input with `chomp: true`
From:
"jeremyevans0 (Jeremy Evans)" <noreply@...>
Date:
2022-05-26 22:45:29 UTC
List:
ruby-core #108720
Issue #18769 has been updated by jeremyevans0 (Jeremy Evans).
I've submitted a pull request to fix this: https://github.com/ruby/stringio/pull/30
----------------------------------------
Bug #18769: StringIO#each hangs up on some input with `chomp: true`
https://bugs.ruby-lang.org/issues/18769#change-97771
* Author: andrykonchin (Andrew Konchin)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.0.3
* Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN
----------------------------------------
The mentioned StringIO method `#each` (as well as `#readlines` and `#each_line`) may hang up when passed a separator and `chomp: true`:
```ruby
require 'stringio'
StringIO.new('a||b||c').each("||", chomp: true) { |s| p s }
""
""
""
""
""
""
""
```
The same way behave other two methods:
```ruby
StringIO.new('a||b||c').readlines("||", chomp: true)
StringIO.new('a||b||c').each_line("||", chomp: true) { |s| p s }
```
--
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>