Actions
Bug #17661
closedIO#each will segfault when if file is closed inside an `each_byte` block
Description
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:
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
Actions
Like0
Like0Like0Like0Like0Like0Like0