From: peter@... Date: 2020-08-11T20:02:31+00:00 Subject: [ruby-core:99561] [Ruby master Bug#17117] Corruption in ARGF.inplace Issue #17117 has been reported by peterzhu2118 (Peter Zhu). ---------------------------------------- Bug #17117: Corruption in ARGF.inplace https://bugs.ruby-lang.org/issues/17117 * Author: peterzhu2118 (Peter Zhu) * Status: Open * Priority: Normal * ruby -v: ruby 2.8.0dev (2020-08-11T19:09:12Z inplace-str-corrup.. 16d72713d2) [x86_64-darwin19] * Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN ---------------------------------------- Extension string stored in `ARGF.inplace` is created using an api designed for C string constants to create a Ruby string that points at another Ruby string. When the original string is swept, the extension string gets corrupted. Reproduction script (on MacOS): ```ruby #!/usr/bin/ruby -pi.bak BEGIN { GC.start(full_mark: true) arr = [] 1000000.times do |x| arr << "fooo#{x}" end } puts "hello" ``` [Fix PR on GitHub](https://github.com/ruby/ruby/pull/3409) -- https://bugs.ruby-lang.org/ Unsubscribe: