Skip to content

Conversation

@peterzhu2118
Copy link
Member

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.

[Bug #21173]

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.
@peterzhu2118 peterzhu2118 merged commit 6bad47a into ruby:master Mar 6, 2025
76 checks passed
@peterzhu2118 peterzhu2118 deleted the free-at-exit-require-error branch March 6, 2025 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant