
9 Aug
2023
9 Aug
'23
4:08 p.m.
Issue #19835 has been reported by peterzhu2118 (Peter Zhu). ---------------------------------------- Bug #19835: Parser leaks memory for incomplete tokens https://bugs.ruby-lang.org/issues/19835 * Author: peterzhu2118 (Peter Zhu) * Status: Open * Priority: Normal * Backport: 3.0: REQUIRED, 3.1: REQUIRED, 3.2: REQUIRED ---------------------------------------- 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/