
5 Mar
2025
5 Mar
'25
7:26 p.m.
Issue #21173 has been reported by peterzhu2118 (Peter Zhu). ---------------------------------------- Bug #21173: RUBY_FREE_AT_EXIT does not work when error in -r https://bugs.ruby-lang.org/issues/21173 * Author: peterzhu2118 (Peter Zhu) * Status: Open * Backport: 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONTNEED, 3.4: REQUIRED ---------------------------------------- PR: https://github.com/ruby/ruby/pull/12859 When loading a file using the command line -r, it is processed before RUBY_FREE_AT_EXIT is checked. So if the loaded file raises an error, it will cause memory to not be freed with RUBY_FREE_AT_EXIT. For example `ruby -rtest.rb -e ""` will report a large amount of memory leaks if `test.rb` raises. -- https://bugs.ruby-lang.org/