[#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:102635] [Ruby master Bug#17661] IO#each will segfault when if file is closed inside an `each_byte` block
From:
xtkoba+ruby@...
Date:
2021-02-27 02:46:57 UTC
List:
ruby-core #102635
Issue #17661 has been updated by xtkoba (Tee KOBAYASHI). Probably `'s|http://||'` to the reproducer? ---------------------------------------- Bug #17661: IO#each will segfault when if file is closed inside an `each_byte` block https://bugs.ruby-lang.org/issues/17661#change-90627 * Author: tenderlovemaking (Aaron Patterson) * Status: Open * Priority: Normal * Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN ---------------------------------------- As reported here: https://twitter.com/asterite/status/1363487990203506689 when iterating through a file's contents with #each_byte, if the filehandle is closed inside of the block yielded to by #each byte, this condition is not detected, and a segmentation fault is thrown. Repro: ```ruby file = http://File.open(__FILE__) file.each_byte do |byte| p byte file.close end ``` Proposed fix is here: https://github.com/ruby/ruby/pull/4217 -- 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>