[#107008] [Ruby master Bug#18465] Make `IO#write` atomic. — "ioquatix (Samuel Williams)" <noreply@...>
Issue #18465 has been reported by ioquatix (Samuel Williams).
16 messages
2022/01/09
[#107150] [Ruby master Feature#18494] [RFC] ENV["RUBY_GC_..."]= changes GC parameters dynamically — "ko1 (Koichi Sasada)" <noreply@...>
Issue #18494 has been updated by ko1 (Koichi Sasada).
4 messages
2022/01/17
[#107170] Re: [Ruby master Feature#18494] [RFC] ENV["RUBY_GC_..."]= changes GC parameters dynamically
— Eric Wong <normalperson@...>
2022/01/17
> https://bugs.ruby-lang.org/issues/18494
[#107302] [Ruby master Bug#18553] Memory leak on compiling method call with kwargs — "ibylich (Ilya Bylich)" <noreply@...>
Issue #18553 has been reported by ibylich (Ilya Bylich).
4 messages
2022/01/27
[#107346] [Ruby master Misc#18557] DevMeeting-2022-02-17 — "mame (Yusuke Endoh)" <noreply@...>
Issue #18557 has been reported by mame (Yusuke Endoh).
18 messages
2022/01/29
[ruby-core:107292] [Ruby master Bug#18516] Memory leak on aliasing method to itself
From:
"nobu (Nobuyoshi Nakada)" <noreply@...>
Date:
2022-01-26 15:44:51 UTC
List:
ruby-core #107292
Issue #18516 has been updated by nobu (Nobuyoshi Nakada).
https://github.com/ruby/ruby/pull/5493
----------------------------------------
Bug #18516: Memory leak on aliasing method to itself
https://bugs.ruby-lang.org/issues/18516#change-96156
* Author: ibylich (Ilya Bylich)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.2.0dev
* Backport: 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN
----------------------------------------
The following code produces a memory leak:
```ruby
class A
1.upto(Float::INFINITY) do |i|
define_method(:"foo_#{i}") {}
alias :"foo_#{i}" :"foo_#{i}"
remove_method :"foo_#{i}"
end
end
```
It is very artificial, but it's required for LSAN/Valgrind integration.
The reason why it leaks is the following:
+ alias foo foo increments alias_count even if no alias is created
+ later during GC rb_free_method_entry is called that in turn calls rb_method_definition_release that calls free only if alias_count + complemented_count == 0.
+ In this particular case alias_count is 1, and so no cleanup happens.
I've been asked to create tickets for memory leaks that I find during LSAN integration if the leak affects previous versions of Ruby. From what I see it does.
Possible fix: https://github.com/ruby/ruby/pull/5492. But like I mentioned in PR I'm not sure if it's correct, @nobu mentioned in [my main PR](https://github.com/ruby/ruby/pull/5488) aliasing method to itself is used to swallow some warning on method redefinition, but I don't what's the case there.
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>