From: "hsbt (Hiroshi SHIBATA) via ruby-core" Date: 2023-02-18T06:27:00+00:00 Subject: [ruby-core:112486] [Ruby master Bug#19445] Segmentation fault with Numeric#step Issue #19445 has been updated by hsbt (Hiroshi SHIBATA). Thanks @nobu. I confirmed to fix this. ``` $ curl -s 'https://cache.ruby-lang.org/pub/misc/ci_versions/all.json' -o ruby_versions.json ruby -v -rjson -e "min = JSON.parse(File.read('ruby_versions.json')).sort.first; p 2.2.step(by: 0.1, to: min).map{|v| v.round(1).to_s }" ruby 3.3.0dev (2023-02-18T05:49:21Z master de7eb5e79a) +YJIT [arm64-darwin21] -e:1:in `step': no implicit conversion to float from string (TypeError) from -e:1:in `each' from -e:1:in `map' from -e:1:in `
' ``` and also confirmed this issue happened with Ruby 3.0, 3.1 and 3.2. ---------------------------------------- Bug #19445: Segmentation fault with Numeric#step https://bugs.ruby-lang.org/issues/19445#change-101929 * Author: hsbt (Hiroshi SHIBATA) * Status: Closed * Priority: Normal * Backport: 2.7: DONTNEED, 3.0: REQUIRED, 3.1: REQUIRED, 3.2: REQUIRED ---------------------------------------- The following commands will cause a segmentation fault. ``` curl -s 'https://cache.ruby-lang.org/pub/misc/ci_versions/all.json' -o ruby_versions.json ruby -rjson -e "min = JSON.parse(File.read('ruby_versions.json')).sort.first; p 2.2.step(by: 0.1, to: min).map{|v| v.round(1).to_s }" ``` Note: above code is working with `min.to_f` instead of `min` in `Numeric#step`. -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/