Project

General

Profile

Bug #16354

Memory corruption in Enumerable#reverse_each

Added by ktsj (Kazuki Tsujimoto) 9 months ago. Updated 8 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
[ruby-dev:50867]

Description

Enumerable#reverse_eachのブロック呼び出し中に、対象のEnumerableをto_aしたものを捕まえてサイズを変更するとSEGVすることがあります。

$ ruby -e '(0...1000).reverse_each {|i| i.inspect; ObjectSpace.each_object(Array) {|a| a.clear if a.length == 1000 }}'
-e:1: [BUG] Segmentation fault at 0x0000000000005f19
#1

Updated by ktsj (Kazuki Tsujimoto) 9 months ago

  • Status changed from Open to Closed

Applied in changeset git|ff41663403d3eb76d95f465cb94e14d2faaa04d1.


Fix memory corruption in Enumerable#reverse_each [ruby-dev:50867] [Bug #16354]

Updated by nagachika (Tomoyuki Chikanaga) 8 months ago

  • Backport changed from 2.5: REQUIRED, 2.6: REQUIRED to 2.5: REQUIRED, 2.6: DONE

ruby_2_6 r67835 merged revision(s) ff41663403d3eb76d95f465cb94e14d2faaa04d1.

Also available in: Atom PDF