[ruby-core:114386] [Ruby master Bug#19835] Parser leaks memory for incomplete tokens
From:
"nagachika (Tomoyuki Chikanaga) via ruby-core" <ruby-core@...>
Date:
2023-08-13 04:35:51 UTC
List:
ruby-core #114386
Issue #19835 has been updated by nagachika (Tomoyuki Chikanaga).
Backport changed from 3.0: REQUIRED, 3.1: REQUIRED, 3.2: REQUIRED to 3.0: REQUIRED, 3.1: REQUIRED, 3.2: DONE
ruby_3_2 6898389a0f640c4155a7073579f43d1e16893698 merged revision(s) 5bc8fceca8d47ed1ef9c603c6531a408de36b60c.
----------------------------------------
Bug #19835: Parser leaks memory for incomplete tokens
https://bugs.ruby-lang.org/issues/19835#change-104134
* Author: peterzhu2118 (Peter Zhu)
* Status: Closed
* Priority: Normal
* Backport: 3.0: REQUIRED, 3.1: REQUIRED, 3.2: DONE
----------------------------------------
GitHub Pull Request: https://github.com/ruby/ruby/pull/8192
The parser does not free the `tbl` of the `struct vtable` when there are leftover `lvtbl` in the parser. This causes a memory leak.
The following script reproduces this issue:
```ruby
10.times do
100_000.times do
Ripper.parse("class Foo")
end
puts `ps -o rss= -p #{$$}`
end
```
--
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/