From: "segiddins (Samuel Giddins) via ruby-core" Date: 2024-12-11T02:05:26+00:00 Subject: [ruby-core:120173] [Ruby master Bug#20942] Infinite loop when out of memory Issue #20942 has been reported by segiddins (Samuel Giddins). ---------------------------------------- Bug #20942: Infinite loop when out of memory https://bugs.ruby-lang.org/issues/20942 * Author: segiddins (Samuel Giddins) * Status: Open * ruby -v: ruby 3.4.0dev (2024-12-10T10:28:22Z master 3568e7aef7) +PRISM [aarch64-linux] * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- Similar setup to https://bugs.ruby-lang.org/issues/20941 Pure-ruby reproduction of https://bugs.ruby-lang.org/issues/20629 ```ruby #!/usr/bin/env -S RUBYOPT="--disable-gems" gdb --args ruby -v STDOUT.sync = true es = Array.new(10000) { Object.new } es = Array.new(10000) { 0 } Process.warmup puts "warmup" Process.setrlimit(:DATA, 0) i = 0 loop do begin Array.new(-1) rescue ArgumentError => e es[i += 1] = e end end ``` Backtrace every time I pause in the debugger: ``` (gdb) bt #0 rb_multi_ractor_p () at /usr/src/ruby/vm_sync.h:40 #1 rb_vm_lock_leave (line=245, file=, lev=) at /usr/src/ruby/vm_sync.h:92 #2 rb_ec_vm_lock_rec_release (ec=ec@entry=0xaaaaaaabb4f0, recorded_lock_rec=0, current_lock_rec=1) at /usr/src/ruby/vm_sync.c:245 #3 0x0000fffff7c3badc in rb_ec_vm_lock_rec_check (recorded_lock_rec=, ec=0xaaaaaaabb4f0) at /usr/src/ruby/eval_intern.h:136 #4 rb_ec_tag_state (ec=0xaaaaaaabb4f0) at /usr/src/ruby/eval_intern.h:147 #5 rb_vm_exec (ec=0xaaaaaaabb4f0) at /usr/src/ruby/vm.c:2584 #6 0x0000fffff7a52c18 in rb_ec_exec_node (ec=ec@entry=0xaaaaaaabb4f0, n=n@entry=0xfffff72c5068) at /usr/src/ruby/eval.c:281 #7 0x0000fffff7a563b4 in ruby_run_node (n=0xfffff72c5068) at /usr/src/ruby/eval.c:319 #8 0x0000aaaaaaaa0b6c in rb_main (argv=0xfffffffffce8, argc=3) at /usr/src/ruby/main.c:43 #9 main (argc=, argv=) at /usr/src/ruby/main.c:68 ``` -- 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/lists/ruby-core.ml.ruby-lang.org/