[ruby-core:122218] [Ruby Bug#21357] Crash in Hash#merge! with ruby-dev in rubocop-rspec test suite

Issue #21357 has been reported by Earlopain (Earlopain _). ---------------------------------------- Bug #21357: Crash in Hash#merge! with ruby-dev in rubocop-rspec test suite https://bugs.ruby-lang.org/issues/21357 * Author: Earlopain (Earlopain _) * Status: Open * ruby -v: ruby 3.5.0dev (2025-05-20T09:22:41Z master a82e7132df) +PRISM [x86_64-linux] * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- I've encountered crahses on ruby-head in recent days, related to hash methods like `merge` and `merge!`. I can now reproduce it locally while running the rubocop-rspec test suite: * Clone https://github.com/rubocop/rubocop-rspec * Run `NO_COVERAGE=1 bundle exec rake spec` I attached the crash report. I want to reduce this down but have no idea how. The crash is very consistent for me though, it doesn't take very long for it to happen (only a few seconds usually). There were changes to these methods like https://bugs.ruby-lang.org/issues/21305, maybe related. ---Files-------------------------------- test.log (224 KB) -- https://bugs.ruby-lang.org/

Issue #21357 has been updated by Earlopain (Earlopain _). I reduced it down significantly: ```rb require "yaml" YML = <<~YML foo: - bar: abc baz: def bat: ghi YML x = 1500 # lower numbers don't consistently crash (0..x).each_with_object({}) do |_i, hash| hash.merge!(YAML.safe_load(YML)) do |_key, first, second| first.concat(second) end end ``` This doesn't have much in common with the real code anymore, but the crash is the same. ---------------------------------------- Bug #21357: Crash in Hash#merge! with ruby-dev in rubocop-rspec test suite https://bugs.ruby-lang.org/issues/21357#change-113368 * Author: Earlopain (Earlopain _) * Status: Open * ruby -v: ruby 3.5.0dev (2025-05-20T09:22:41Z master a82e7132df) +PRISM [x86_64-linux] * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- I've encountered crahses on ruby-head in recent days, related to hash methods like `merge` and `merge!`. I can now reproduce it locally while running the rubocop-rspec test suite: * Clone https://github.com/rubocop/rubocop-rspec * Run `NO_COVERAGE=1 bundle exec rake spec` I attached the crash report. I want to reduce this down but have no idea how. The crash is very consistent for me though, it doesn't take very long for it to happen (only a few seconds usually). There were related(?) changes to hash like https://bugs.ruby-lang.org/issues/21333, maybe related. ---Files-------------------------------- test.log (224 KB) -- https://bugs.ruby-lang.org/

Issue #21357 has been updated by dodecadaniel (Daniel Colson). Possible fix https://github.com/ruby/ruby/pull/13404 (if tests pass 🤞🏻) ---------------------------------------- Bug #21357: Crash in Hash#merge! with ruby-dev in rubocop-rspec test suite https://bugs.ruby-lang.org/issues/21357#change-113370 * Author: Earlopain (Earlopain _) * Status: Open * ruby -v: ruby 3.5.0dev (2025-05-20T09:22:41Z master a82e7132df) +PRISM [x86_64-linux] * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- I've encountered crahses on ruby-head in recent days, related to hash methods like `merge` and `merge!`. I can now reproduce it locally while running the rubocop-rspec test suite: * Clone https://github.com/rubocop/rubocop-rspec * Run `NO_COVERAGE=1 bundle exec rake spec` I attached the crash report. I want to reduce this down but have no idea how. The crash is very consistent for me though, it doesn't take very long for it to happen (only a few seconds usually). There were related(?) changes to hash like https://bugs.ruby-lang.org/issues/21333, maybe related. ---Files-------------------------------- test.log (224 KB) -- https://bugs.ruby-lang.org/

Issue #21357 has been updated by Earlopain (Earlopain _). Thanks! Works nicely. ---------------------------------------- Bug #21357: Crash in Hash#merge! with ruby-dev in rubocop-rspec test suite https://bugs.ruby-lang.org/issues/21357#change-113374 * Author: Earlopain (Earlopain _) * Status: Closed * ruby -v: ruby 3.5.0dev (2025-05-20T09:22:41Z master a82e7132df) +PRISM [x86_64-linux] * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- I've encountered crahses on ruby-head in recent days, related to hash methods like `merge` and `merge!`. I can now reproduce it locally while running the rubocop-rspec test suite: * Clone https://github.com/rubocop/rubocop-rspec * Run `NO_COVERAGE=1 bundle exec rake spec` I attached the crash report. I want to reduce this down but have no idea how. The crash is very consistent for me though, it doesn't take very long for it to happen (only a few seconds usually). There were related(?) changes to hash like https://bugs.ruby-lang.org/issues/21333, maybe related. ---Files-------------------------------- test.log (224 KB) -- https://bugs.ruby-lang.org/

Issue #21357 has been updated by nagachika (Tomoyuki Chikanaga). Backport changed from 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: REQUIRED to 3.2: UNKNOWN, 3.3: REQUIRED, 3.4: REQUIRED I'm going to backport the fix for #21333, and fill Backport field REQUIRED for 3.3. ---------------------------------------- Bug #21357: Crash in Hash#merge! with ruby-dev in rubocop-rspec test suite https://bugs.ruby-lang.org/issues/21357#change-113409 * Author: Earlopain (Earlopain _) * Status: Closed * ruby -v: ruby 3.5.0dev (2025-05-20T09:22:41Z master a82e7132df) +PRISM [x86_64-linux] * Backport: 3.2: UNKNOWN, 3.3: REQUIRED, 3.4: REQUIRED ---------------------------------------- I've encountered crahses on ruby-head in recent days, related to hash methods like `merge` and `merge!`. I can now reproduce it locally while running the rubocop-rspec test suite: * Clone https://github.com/rubocop/rubocop-rspec * Run `NO_COVERAGE=1 bundle exec rake spec` I attached the crash report. I want to reduce this down but have no idea how. The crash is very consistent for me though, it doesn't take very long for it to happen (only a few seconds usually). There were related(?) changes to hash like https://bugs.ruby-lang.org/issues/21333, maybe related. ---Files-------------------------------- test.log (224 KB) -- https://bugs.ruby-lang.org/

Issue #21357 has been updated by nagachika (Tomoyuki Chikanaga). Backport changed from 3.2: UNKNOWN, 3.3: REQUIRED, 3.4: REQUIRED to 3.2: UNKNOWN, 3.3: DONE, 3.4: REQUIRED ruby_3_3 commit:24c994b91a67f0023e8fe22a5428581110564332 merged revision(s) commit:056497319658cbefe22351c6ec5c9fa6e4df72bd. ---------------------------------------- Bug #21357: Crash in Hash#merge! with ruby-dev in rubocop-rspec test suite https://bugs.ruby-lang.org/issues/21357#change-113411 * Author: Earlopain (Earlopain _) * Status: Closed * ruby -v: ruby 3.5.0dev (2025-05-20T09:22:41Z master a82e7132df) +PRISM [x86_64-linux] * Backport: 3.2: UNKNOWN, 3.3: DONE, 3.4: REQUIRED ---------------------------------------- I've encountered crahses on ruby-head in recent days, related to hash methods like `merge` and `merge!`. I can now reproduce it locally while running the rubocop-rspec test suite: * Clone https://github.com/rubocop/rubocop-rspec * Run `NO_COVERAGE=1 bundle exec rake spec` I attached the crash report. I want to reduce this down but have no idea how. The crash is very consistent for me though, it doesn't take very long for it to happen (only a few seconds usually). There were related(?) changes to hash like https://bugs.ruby-lang.org/issues/21333, maybe related. ---Files-------------------------------- test.log (224 KB) -- https://bugs.ruby-lang.org/

Issue #21357 has been updated by k0kubun (Takashi Kokubun). Backport changed from 3.2: UNKNOWN, 3.3: DONE, 3.4: REQUIRED to 3.2: UNKNOWN, 3.3: DONE, 3.4: DONE ruby_3_4 commit:1bdae3404b2918a8823d2fbac2f9e30f778aa1c9 merged revision(s) commit:056497319658cbefe22351c6ec5c9fa6e4df72bd. ---------------------------------------- Bug #21357: Crash in Hash#merge! with ruby-dev in rubocop-rspec test suite https://bugs.ruby-lang.org/issues/21357#change-114027 * Author: Earlopain (Earlopain _) * Status: Closed * ruby -v: ruby 3.5.0dev (2025-05-20T09:22:41Z master a82e7132df) +PRISM [x86_64-linux] * Backport: 3.2: UNKNOWN, 3.3: DONE, 3.4: DONE ---------------------------------------- I've encountered crahses on ruby-head in recent days, related to hash methods like `merge` and `merge!`. I can now reproduce it locally while running the rubocop-rspec test suite: * Clone https://github.com/rubocop/rubocop-rspec * Run `NO_COVERAGE=1 bundle exec rake spec` I attached the crash report. I want to reduce this down but have no idea how. The crash is very consistent for me though, it doesn't take very long for it to happen (only a few seconds usually). There were related(?) changes to hash like https://bugs.ruby-lang.org/issues/21333, maybe related. ---Files-------------------------------- test.log (224 KB) -- https://bugs.ruby-lang.org/
participants (4)
-
dodecadaniel (Daniel Colson)
-
Earlopain (Earlopain _)
-
k0kubun (Takashi Kokubun)
-
nagachika (Tomoyuki Chikanaga)