ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:122336] [Ruby Bug#21383] Prism leaks memory with invalid yield
@ 2025-05-29 14:02 peterzhu2118 (Peter Zhu) via ruby-core
  0 siblings, 0 replies; only message in thread
From: peterzhu2118 (Peter Zhu) via ruby-core @ 2025-05-29 14:02 UTC (permalink / raw)
  To: ruby-core; +Cc: peterzhu2118 (Peter Zhu)

Issue #21383 has been reported by peterzhu2118 (Peter Zhu).

----------------------------------------
Bug #21383: Prism leaks memory with invalid yield
https://bugs.ruby-lang.org/issues/21383

* Author: peterzhu2118 (Peter Zhu)
* Status: Open
* Backport: 3.2: DONTNEED, 3.3: DONTNEED, 3.4: REQUIRED
----------------------------------------
Fix: https://github.com/ruby/ruby/pull/13464

The following script leaks memory:

```ruby
10.times do
  20_000.times do
    eval("class C; yield; end")
  rescue SyntaxError
  end

  puts `ps -o rss= -p #{$$}`
end
```

Before:

```
16464
25536
29424
35904
39552
44576
46736
51600
56096
59824
```

After:

```
13488
16160
18240
20528
19760
21808
21680
22272
22064
22336
```



-- 
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:[~2025-05-29 14:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-05-29 14:02 [ruby-core:122336] [Ruby Bug#21383] Prism leaks memory with invalid yield peterzhu2118 (Peter Zhu) 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).