[ruby-core:112459] [Ruby master Bug#19445] Segmentation fault with Numeric#step

Issue #19445 has been reported by hsbt (Hiroshi SHIBATA). ---------------------------------------- Bug #19445: Segmentation fault with Numeric#step https://bugs.ruby-lang.org/issues/19445 * Author: hsbt (Hiroshi SHIBATA) * Status: Open * Priority: Normal * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- 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/

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 `<main>' ``` 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/

Issue #19445 has been updated by byroot (Jean Boussier). Apologies, but I'm a bit confused. I see @nobu marked the issue as closed with needing backport, but I don't see any associated fix. Did I miss something? ---------------------------------------- Bug #19445: Segmentation fault with Numeric#step https://bugs.ruby-lang.org/issues/19445#change-101932 * 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/

Issue #19445 has been updated by nobu (Nobuyoshi Nakada). https://bugs.ruby-lang.org/issues/19445?tab=changesets I missed the space between `Bug` and `#`, then linked manually. ---------------------------------------- Bug #19445: Segmentation fault with Numeric#step https://bugs.ruby-lang.org/issues/19445#change-101933 * 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/

Issue #19445 has been updated by hsbt (Hiroshi SHIBATA). Today I learned "Associated revisions" tab in Redmine. ---------------------------------------- Bug #19445: Segmentation fault with Numeric#step https://bugs.ruby-lang.org/issues/19445#change-101934 * 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/

Issue #19445 has been updated by naruse (Yui NARUSE). Backport changed from 2.7: DONTNEED, 3.0: REQUIRED, 3.1: REQUIRED, 3.2: REQUIRED to 2.7: DONTNEED, 3.0: REQUIRED, 3.1: REQUIRED, 3.2: DONE ruby_3_2 59eb18037ff92839be48fb6c46ff0acc179b4f4c merged revision(s) dd28c55a7cd6780dad637b4d6a20507fbfc6af4a. ---------------------------------------- Bug #19445: Segmentation fault with Numeric#step https://bugs.ruby-lang.org/issues/19445#change-102199 * Author: hsbt (Hiroshi SHIBATA) * Status: Closed * Priority: Normal * Backport: 2.7: DONTNEED, 3.0: REQUIRED, 3.1: REQUIRED, 3.2: DONE ---------------------------------------- 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/

Issue #19445 has been updated by nagachika (Tomoyuki Chikanaga). Backport changed from 2.7: DONTNEED, 3.0: REQUIRED, 3.1: REQUIRED, 3.2: DONE to 2.7: DONTNEED, 3.0: REQUIRED, 3.1: DONE, 3.2: DONE ruby_3_1 5428bdc1daed12d1e142a854fc037a1a4eb647c9 merged revision(s) dd28c55a7cd6780dad637b4d6a20507fbfc6af4a. ---------------------------------------- Bug #19445: Segmentation fault with Numeric#step https://bugs.ruby-lang.org/issues/19445#change-102493 * Author: hsbt (Hiroshi SHIBATA) * Status: Closed * Priority: Normal * Backport: 2.7: DONTNEED, 3.0: REQUIRED, 3.1: DONE, 3.2: DONE ---------------------------------------- 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/
participants (5)
-
byroot (Jean Boussier)
-
hsbt (Hiroshi SHIBATA)
-
nagachika (Tomoyuki Chikanaga)
-
naruse (Yui NARUSE)
-
nobu (Nobuyoshi Nakada)