[#104740] [Ruby master Feature#18057] Introduce Array#average — ggmichaelgo@...

Issue #18057 has been reported by ggmichaelgo (Michael Go).

14 messages 2021/08/02

[#104774] [Ruby master Bug#18061] Execshield test: libruby.so.N.N.N: FAIL: property-note test because no .note.gnu.property section found — jaruga@...

Issue #18061 has been reported by jaruga (Jun Aruga).

48 messages 2021/08/04

[#104780] [Ruby master Bug#18062] Ruby with enabled LTO segfaults during build — v.ondruch@...

Issue #18062 has been reported by vo.x (Vit Ondruch).

30 messages 2021/08/05

[#104831] [Ruby master Bug#18066] Load did_you_mean eve/error_highlight even with --disable-gems — v.ondruch@...

Issue #18066 has been reported by vo.x (Vit Ondruch).

10 messages 2021/08/07

[#104851] [Ruby master Bug#18073] test/ruby/test_jit.rb: failures "error: invalid use of '__builtin_va_arg_pack ()'" on Ruby 2.7.4 on gcc 4.8.5 on RHEL7 — jaruga@...

Issue #18073 has been reported by jaruga (Jun Aruga).

14 messages 2021/08/09

[#104927] [Ruby master Bug#18077] Marshal.dump(closed_io) raises IOError instead of TypeError — "larskanis (Lars Kanis)" <noreply@...>

Issue #18077 has been reported by larskanis (Lars Kanis).

10 messages 2021/08/16

[#104960] [Ruby master Feature#18083] Capture error in ensure block. — "ioquatix (Samuel Williams)" <noreply@...>

Issue #18083 has been reported by ioquatix (Samuel Williams).

32 messages 2021/08/18

[#105021] [Ruby master Misc#18122] DevelopersMeeting20210916Japan — "mame (Yusuke Endoh)" <noreply@...>

Issue #18122 has been reported by mame (Yusuke Endoh).

12 messages 2021/08/20

[#105069] [Ruby master Bug#18133] LTO: TestGCCompact#test_ast_compacts segfaults on i686 — "vo.x (Vit Ondruch)" <noreply@...>

Issue #18133 has been reported by vo.x (Vit Ondruch).

25 messages 2021/08/25

[#105077] [Ruby master Feature#18136] take_while_after — "zverok (Victor Shepelev)" <noreply@...>

Issue #18136 has been reported by zverok (Victor Shepelev).

21 messages 2021/08/27

[ruby-core:104788] [Ruby master Bug#17806] Bad interaction between method cache, prepend, and refinements

From: mkaeppler@...
Date: 2021-08-05 11:49:30 UTC
List: ruby-core #104788
Issue #17806 has been updated by mk (Matthias K舊pler).


Hi @alanwu,

at GitLab we are currently working on making our application Ruby 3 ready.

We are running into a strange issue in our test suite where refinements fails to be applied when everything suggests they should be.

During my research I stumbled on this issue here and I was wondering if you could give me your thoughts on whether this could be a Ruby VM bug.

I summarized in this issue what the problem is: https://gitlab.com/gitlab-org/gitlab/-/issues/337614

To recap the high-level highlights and observations:

- We use rspec-parameterized and its table-syntax extension (which overrides the pipe `|` operator using refinements)
- Whenever we run a test that composes a test table using integer arguments, Ruby will invoke the built-in bitwise-OR instead of the refinement, thus breaking the test
- When I add another refinement to Integer at the top of the test file, even when not `using` it, the test will start to pass

This leads me to believe it could be due to Ruby's method table being messed up somehow, since it is very suspicious that by refining a class with an unused method, another refinement should suddenly start to apply. Since this changeset here touches the caching behavior, I thought you might have an idea whether it could be related.

We also verified that this happens not just with 3.0.2, but also 3.0.1, but works on 2.7, so it is likely not strictly related to this particular change. But since I have no evidence that it is in fact a Ruby bug, I was also hesitant to open a new issue.

I have so far not been able to produce a minimal executable test case either.

Any hints and thoughts for how to debug this would be appreciated!

----------------------------------------
Bug #17806: Bad interaction between method cache, prepend, and refinements
https://bugs.ruby-lang.org/issues/17806#change-93123

* Author: alanwu (Alan Wu)
* Status: Closed
* Priority: Normal
* ruby -v: ruby 3.0.1p64 (2021-04-05 revision 0fb782ee38) [x86_64-darwin19]
* Backport: 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: DONE
----------------------------------------
I'm running into a couple of issues with Ruby 3's new method cache and
refinements.

The first script raises `SystemStackError` unexpectedly:

```ruby
module R1
  refine Hash do
    def foo; :r1; end
  end
end
class Hash
  prepend(Module.new)
end
class Hash
  def foo; end
end
{}.method(:foo) # put it on pCMC
module R2
  refine Hash do
    def foo; :r2; end
  end
end
{}.foo # SystemStackError
```

The second script calls the wrong method:

```ruby
klass = Class.new { def foo; end }
_refinement = Module.new do
  refine(klass) { def foo; :refined; end }
end
klass.prepend(Module.new)
klass.new.foo # cache foo
klass.define_method(:foo) { :second }
p klass.new.foo # prints nil. False caching.
```

I submitted a GitHub PR to fix the issue: https://github.com/ruby/ruby/pull/4386



-- 
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>

In This Thread