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
  2025-07-14 20:54 ` [ruby-core:122749] " k0kubun (Takashi Kokubun) via ruby-core
  0 siblings, 1 reply; 2+ messages 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] 2+ messages in thread

* [ruby-core:122749] [Ruby Bug#21383] Prism leaks memory with invalid yield
  2025-05-29 14:02 [ruby-core:122336] [Ruby Bug#21383] Prism leaks memory with invalid yield peterzhu2118 (Peter Zhu) via ruby-core
@ 2025-07-14 20:54 ` k0kubun (Takashi Kokubun) via ruby-core
  0 siblings, 0 replies; 2+ messages in thread
From: k0kubun (Takashi Kokubun) via ruby-core @ 2025-07-14 20:54 UTC (permalink / raw)
  To: ruby-core; +Cc: k0kubun (Takashi Kokubun)

Issue #21383 has been updated by k0kubun (Takashi Kokubun).

Backport changed from 3.2: DONTNEED, 3.3: DONTNEED, 3.4: REQUIRED to 3.2: DONTNEED, 3.3: DONTNEED, 3.4: DONE

ruby_3_4 commit:cdb039d3e4f76ee01744814e5f08395835fa8e63 merged revision(s) commit:9f91f3617bab2ee220d298ddb874ef73b10dac23.

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

* Author: peterzhu2118 (Peter Zhu)
* Status: Closed
* Backport: 3.2: DONTNEED, 3.3: DONTNEED, 3.4: DONE
----------------------------------------
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] 2+ messages in thread

end of thread, other threads:[~2025-07-14 20:55 UTC | newest]

Thread overview: 2+ messages (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
2025-07-14 20:54 ` [ruby-core:122749] " k0kubun (Takashi Kokubun) 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).