From: "jeremyevans0 (Jeremy Evans) via ruby-core" Date: 2023-04-11T03:10:36+00:00 Subject: [ruby-core:113183] [Ruby master Bug#19589] Expecting system stack error but crashing Issue #19589 has been updated by jeremyevans0 (Jeremy Evans). Backport changed from 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN to 3.0: DONTNEED, 3.1: DONTNEED, 3.2: REQUIRED This happens when the iteration level in the hash goes from being stored in the flags to being stored in an instance variable (after 127 levels). Here is the top of the backtrace: ``` #0 rb_shape_get_iv_index (shape=0xb4b36a7afe0, id=13999, value=0x7f7ffffb9378) at shape.c:433 #1 0x00000b2be1b0ddd9 in generic_ivar_set (obj=12282921923520, id=13999, val=255) at variable.c:1271 #2 ivar_set (obj=12282921923520, id=13999, val=255) at variable.c:1591 #3 0x00000b2be1978f57 in hash_iter_lev_inc (hash=12282921923520) at hash.c:1367 #4 rb_hash_foreach (hash=12282921923520, func=, farg=) at hash.c:1491 #5 0x00000b2be197e4c0 in rb_hash_each_key (hash=12282921923520) at hash.c:3102 #6 0x00000b2be1b3be8a in vm_call_cfunc_with_frame_ (ec=0xb2b5f97ae50, reg_cfp=0xb2c0ecb00c0, calling=, argc=0, argv=0xb2c0ebb8fa0, stack_bottom=0xb2c0ebb8f98) at ./vm_insnhelper.c:3434 #7 0x00000b2be1b40252 in vm_sendish (ec=0xb2b5f97ae50, reg_cfp=0xb2c0ecb00c0, cd=0xb2c1144eea0, block_handler=, method_explorer=) at ./vm_insnhelper.c:5507 #8 0x00000b2be1b193f5 in vm_exec_core (ec=, initial=) at insns.def:815 #9 0x00000b2be1b2ff54 in rb_vm_exec (ec=) at vm.c:2600 ``` So this is likely related to the introduction of shapes. ---------------------------------------- Bug #19589: Expecting system stack error but crashing https://bugs.ruby-lang.org/issues/19589#change-102721 * Author: alpaca-tc (Hiroyuki Ishii) * Status: Open * Priority: Normal * ruby -v: ruby 3.3.0dev (2023-04-11T00:54:20Z master 65e276096f) [arm64-darwin22] * Backport: 3.0: DONTNEED, 3.1: DONTNEED, 3.2: REQUIRED ---------------------------------------- The following code expects stack overflow but crashes. The version it occurs in is newer than 3.2.0. ``` def expect_system_stack_error(h) h.each_key {} h.each_value { expect_system_stack_error(h) } end expect_system_stack_error(a: nil) ``` -- 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/