[#99115] [Ruby master Bug#17023] How to prevent String memory to be relocated in ruby-ffi — larskanis@...
Issue #17023 has been reported by larskanis (Lars Kanis).
22 messages
2020/07/10
[#99375] [Ruby master Feature#17055] Allow suppressing uninitialized instance variable and method redefined verbose mode warnings — merch-redmine@...
Issue #17055 has been reported by jeremyevans0 (Jeremy Evans).
29 messages
2020/07/28
[#101207] [Ruby master Feature#17055] Allow suppressing uninitialized instance variable and method redefined verbose mode warnings
— merch-redmine@...
2020/12/02
Issue #17055 has been updated by jeremyevans0 (Jeremy Evans).
[#101231] Re: [Ruby master Feature#17055] Allow suppressing uninitialized instance variable and method redefined verbose mode warnings
— Austin Ziegler <halostatue@...>
2020/12/03
What does this mean?
[ruby-core:99119] [Ruby master Bug#17007] SystemStackError when using super inside Module included and lexically inside refinement
From:
merch-redmine@...
Date:
2020-07-10 22:20:27 UTC
List:
ruby-core #99119
Issue #17007 has been updated by jeremyevans0 (Jeremy Evans).
After more analysis, I've determined that this issue is due to CREF handling in method lookup in `search_refined_method`. It fails in the lexical case because the module is affected by the refinement (refinement blocks have an implicit `using` of the refinement themselves, I guess).
You can reproduce the SystemStackError outside of the lexical case by having the refinement activated at the point of method definition:
```ruby
class C
def foo
["C"]
end
end
module M; end
refinement = Module.new do
R = refine C do
def foo
["R"] + super
end
include M
end
end
using refinement
M.define_method(:foo){["M"] + super()}
p C.new.foo
```
You can fix the issue by skipping any refined method during super lookup if the current method also uses the same refinement. I implemented this in a pull request: https://github.com/ruby/ruby/pull/3309.
----------------------------------------
Bug #17007: SystemStackError when using super inside Module included and lexically inside refinement
https://bugs.ruby-lang.org/issues/17007#change-86494
* Author: Eregon (Benoit Daloze)
* Status: Open
* Priority: Normal
* Assignee: shugo (Shugo Maeda)
* ruby -v: ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-linux]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
```ruby
class C
def foo
["C"]
end
end
refinement = Module.new do
R = refine C do
def foo
["R"] + super
end
include Module.new {
def foo
["M"] + super
end
}
end
end
using refinement
p C.new.foo
```
gives
```
$ ruby bug_refine_super.rb
Traceback (most recent call last):
10920: from bug_refine_super.rb:22:in `<main>'
10919: from bug_refine_super.rb:10:in `foo'
10918: from bug_refine_super.rb:15:in `foo'
10917: from bug_refine_super.rb:10:in `foo'
10916: from bug_refine_super.rb:15:in `foo'
10915: from bug_refine_super.rb:10:in `foo'
10914: from bug_refine_super.rb:15:in `foo'
10913: from bug_refine_super.rb:10:in `foo'
... 10908 levels...
4: from bug_refine_super.rb:15:in `foo'
3: from bug_refine_super.rb:10:in `foo'
2: from bug_refine_super.rb:15:in `foo'
1: from bug_refine_super.rb:10:in `foo'
bug_refine_super.rb:15:in `foo': stack level too deep (SystemStackError)
```
OTOH defining the module lexically outside of `refine` works:
```ruby
m = Module.new {
def foo
["M"] + super
end
}
refinement = Module.new do
R = refine C do
def foo
["R"] + super
end
include m
end
end
# result: ["R", "M", "C"]
```
--
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>