ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:120173] [Ruby master Bug#20942] Infinite loop when out of memory
@ 2024-12-11  2:05 segiddins (Samuel Giddins) via ruby-core
  0 siblings, 0 replies; only message in thread
From: segiddins (Samuel Giddins) via ruby-core @ 2024-12-11  2:05 UTC (permalink / raw)
  To: ruby-core; +Cc: segiddins (Samuel Giddins)

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=<synthetic pointer>, lev=<synthetic pointer>) 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=<optimized out>, 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=<optimized out>, argv=<optimized out>) 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/

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-12-11  2:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-11  2:05 [ruby-core:120173] [Ruby master Bug#20942] Infinite loop when out of memory segiddins (Samuel Giddins) via ruby-core

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).