* [ruby-dev:50988] [Ruby master Bug#17494] ruby is hunged when using activesupport + rspec + rspec-parameterized
@ 2020-12-31 11:47 sue445fukuoka
2021-01-01 7:34 ` [ruby-dev:50989] [Ruby master Bug#17494] ruby is hanged " yasuo.honda
` (9 more replies)
0 siblings, 10 replies; 11+ messages in thread
From: sue445fukuoka @ 2020-12-31 11:47 UTC (permalink / raw)
To: ruby-dev
Issue #17494 has been reported by sue445 (Go Sueyoshi).
----------------------------------------
Bug #17494: ruby is hunged when using activesupport + rspec + rspec-parameterized
https://bugs.ruby-lang.org/issues/17494
* Author: sue445 (Go Sueyoshi)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.0.0p0
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
# Example code
## Gemfile
```ruby
# frozen_string_literal: true
source "https://rubygems.org"
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
gem "activesupport", "6.1.0"
gem "rspec", "3.10.0"
gem "rspec-parameterized", "0.4.2"
```
## spec file
``` ruby
require "active_support/all"
require "rspec-parameterized"
describe "CLI" do
subject do
# Expected error, but actual hunged here
cli.foo # <- hunged here
end
it { expect { subject }.to raise_error }
end
xdescribe "GitlabMrRelease::Project" do
describe "#api_version" do
using RSpec::Parameterized::TableSyntax
where(:api_endpoint, :expected) do
"http://example.com/api/v4/" | 4
end
with_them do
# it { should eq expected }
end
end
end
```
all codes are here.
https://github.com/sue445/ruby_3_0_0_bug_report_20201231
# Expected
spec is successful (This is the behavior up to ruby 2.7.2)
# Actual
hunged at line 7
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 11+ messages in thread
* [ruby-dev:50989] [Ruby master Bug#17494] ruby is hanged when using activesupport + rspec + rspec-parameterized
2020-12-31 11:47 [ruby-dev:50988] [Ruby master Bug#17494] ruby is hunged when using activesupport + rspec + rspec-parameterized sue445fukuoka
@ 2021-01-01 7:34 ` yasuo.honda
2021-01-22 5:41 ` [ruby-dev:50991] " sue445fukuoka
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: yasuo.honda @ 2021-01-01 7:34 UTC (permalink / raw)
To: ruby-dev
Issue #17494 has been updated by yahonda (Yasuo Honda).
Looks like this behavior has been triggered by https://github.com/ruby/ruby/commit/b9007b6c548f91e88fd3f2ffa23de740431fa969
* Created one file repro named `rep17494.rb` by adding `require "rspec/autorun"`
```
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
gem "activesupport", "6.1.0"
gem "rspec", "3.10.0"
gem "rspec-parameterized", "0.4.2"
end
require "rspec/autorun"
require "active_support/all"
require "rspec-parameterized"
describe "CLI" do
subject do
# Expected error, but actual hunged here
cli.foo # <- hunged here
end
it { expect { subject }.to raise_error }
end
describe "GitlabMrRelease::Project" do
describe "#api_version" do
using RSpec::Parameterized::TableSyntax
where(:api_endpoint, :expected) do
"http://example.com/api/v4/" | 4
end
with_them do
# it { should eq expected }
end
end
end
```
* Execute rep17494.rb script against Ruby as of f2286925f08406bc857f7b03ad6779a5d61443ae which is the parent commit of b9007b6c548f91e88fd3f2ffa23de740431fa969
```
$ docker run -it --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp rubylang/rubyfarm:f2286925f08406bc857f7b03ad6779a5d61443ae ruby rep17494.rb
```
It works as expected `1 example, 0 failures`.
* Execute rep17494.rb script against Ruby as of b9007b6c548f91e88fd3f2ffa23de740431fa969
```
$ docker run -it --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp rubylang/rubyfarm:b9007b6c548f91e88fd3f2ffa23de740431fa969 ruby rep17494.rb
```
It hangs.
Of course, this reproduce case does not require Docker if you can build Ruby as of each commit.
----------------------------------------
Bug #17494: ruby is hanged when using activesupport + rspec + rspec-parameterized
https://bugs.ruby-lang.org/issues/17494#change-89680
* Author: sue445 (Go Sueyoshi)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.0.0p0
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
# Example code
## Gemfile
```ruby
# frozen_string_literal: true
source "https://rubygems.org"
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
gem "activesupport", "6.1.0"
gem "rspec", "3.10.0"
gem "rspec-parameterized", "0.4.2"
```
## spec file
``` ruby
require "active_support/all"
require "rspec-parameterized"
describe "CLI" do
subject do
# Expected error, but actual hunged here
cli.foo # <- hunged here
end
it { expect { subject }.to raise_error }
end
xdescribe "GitlabMrRelease::Project" do
describe "#api_version" do
using RSpec::Parameterized::TableSyntax
where(:api_endpoint, :expected) do
"http://example.com/api/v4/" | 4
end
with_them do
# it { should eq expected }
end
end
end
```
all codes are here.
https://github.com/sue445/ruby_3_0_0_bug_report_20201231
# Expected
spec is successful (This is the behavior up to ruby 2.7.2)
# Actual
hunged at line 7
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 11+ messages in thread
* [ruby-dev:50991] [Ruby master Bug#17494] ruby is hanged when using activesupport + rspec + rspec-parameterized
2020-12-31 11:47 [ruby-dev:50988] [Ruby master Bug#17494] ruby is hunged when using activesupport + rspec + rspec-parameterized sue445fukuoka
2021-01-01 7:34 ` [ruby-dev:50989] [Ruby master Bug#17494] ruby is hanged " yasuo.honda
@ 2021-01-22 5:41 ` sue445fukuoka
2021-01-22 16:32 ` [ruby-dev:50992] " alpaca-tc
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: sue445fukuoka @ 2021-01-22 5:41 UTC (permalink / raw)
To: ruby-dev
Issue #17494 has been updated by sue445 (Go Sueyoshi).
# Workaround
`require` only minimal files.
In this case, stop to require "active_support/all"
e.g.
``` ruby
# require "active_support/all"
require "active_support/core_ext/time/zones"
require "active_support/core_ext/array/wrap"
require "active_support/core_ext/hash/keys"
require "active_support/core_ext/time/calculations"
```
----------------------------------------
Bug #17494: ruby is hanged when using activesupport + rspec + rspec-parameterized
https://bugs.ruby-lang.org/issues/17494#change-90037
* Author: sue445 (Go Sueyoshi)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.0.0p0
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
# Example code
## Gemfile
```ruby
# frozen_string_literal: true
source "https://rubygems.org"
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
gem "activesupport", "6.1.0"
gem "rspec", "3.10.0"
gem "rspec-parameterized", "0.4.2"
```
## spec file
``` ruby
require "active_support/all"
require "rspec-parameterized"
describe "CLI" do
subject do
# Expected error, but actual hunged here
cli.foo # <- hunged here
end
it { expect { subject }.to raise_error }
end
xdescribe "GitlabMrRelease::Project" do
describe "#api_version" do
using RSpec::Parameterized::TableSyntax
where(:api_endpoint, :expected) do
"http://example.com/api/v4/" | 4
end
with_them do
# it { should eq expected }
end
end
end
```
all codes are here.
https://github.com/sue445/ruby_3_0_0_bug_report_20201231
# Expected
spec is successful (This is the behavior up to ruby 2.7.2)
# Actual
hunged at line 7
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 11+ messages in thread
* [ruby-dev:50992] [Ruby master Bug#17494] ruby is hanged when using activesupport + rspec + rspec-parameterized
2020-12-31 11:47 [ruby-dev:50988] [Ruby master Bug#17494] ruby is hunged when using activesupport + rspec + rspec-parameterized sue445fukuoka
2021-01-01 7:34 ` [ruby-dev:50989] [Ruby master Bug#17494] ruby is hanged " yasuo.honda
2021-01-22 5:41 ` [ruby-dev:50991] " sue445fukuoka
@ 2021-01-22 16:32 ` alpaca-tc
2021-01-25 0:42 ` [ruby-dev:50996] " shyouhei
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: alpaca-tc @ 2021-01-22 16:32 UTC (permalink / raw)
To: ruby-dev
Issue #17494 has been updated by alpaca-tc (Hiroyuki Ishii).
I investigated this issue deeply based on yhonda's example code. Then I succeeded to create tiny reproduction code.
```ruby
Object.prepend(Module.new)
using(Module.new {
refine Object do
def hello; end
end
})
Object.new.hello
module M
def hello; end
end
class A
include M
end
Object.instance_methods #=> hanged!!!
```
----------------------------------------
Bug #17494: ruby is hanged when using activesupport + rspec + rspec-parameterized
https://bugs.ruby-lang.org/issues/17494#change-90040
* Author: sue445 (Go Sueyoshi)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.0.0p0
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
# Example code
## Gemfile
```ruby
# frozen_string_literal: true
source "https://rubygems.org"
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
gem "activesupport", "6.1.0"
gem "rspec", "3.10.0"
gem "rspec-parameterized", "0.4.2"
```
## spec file
``` ruby
require "active_support/all"
require "rspec-parameterized"
describe "CLI" do
subject do
# Expected error, but actual hunged here
cli.foo # <- hunged here
end
it { expect { subject }.to raise_error }
end
xdescribe "GitlabMrRelease::Project" do
describe "#api_version" do
using RSpec::Parameterized::TableSyntax
where(:api_endpoint, :expected) do
"http://example.com/api/v4/" | 4
end
with_them do
# it { should eq expected }
end
end
end
```
all codes are here.
https://github.com/sue445/ruby_3_0_0_bug_report_20201231
# Expected
spec is successful (This is the behavior up to ruby 2.7.2)
# Actual
hunged at line 7
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 11+ messages in thread
* [ruby-dev:50996] [Ruby master Bug#17494] ruby is hanged when using activesupport + rspec + rspec-parameterized
2020-12-31 11:47 [ruby-dev:50988] [Ruby master Bug#17494] ruby is hunged when using activesupport + rspec + rspec-parameterized sue445fukuoka
` (2 preceding siblings ...)
2021-01-22 16:32 ` [ruby-dev:50992] " alpaca-tc
@ 2021-01-25 0:42 ` shyouhei
2021-01-25 8:51 ` [ruby-dev:50997] " nobu
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: shyouhei @ 2021-01-25 0:42 UTC (permalink / raw)
To: ruby-dev
Issue #17494 has been updated by shyouhei (Shyouhei Urabe).
@alpaca-pc Thannk you, I can reproduce that also.
```
zsh % LC_ALL=C gdb --args ./miniruby ~/tmp.rb
GNU gdb (Ubuntu 8.2-0ubuntu1~18.04) 8.2
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./miniruby...done.
(gdb) run
Starting program: /miniruby /tmp.rb
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
# <<<<<<< Yes, I can reproduce
^C
Program received signal SIGINT, Interrupt.
search_method_protect (defined_class_ptr=0x0, id=30865, klass=93824998598240) at vm_method.c:986
warning: Source file is more recent than executable.
986 if (defined_class_ptr) *defined_class_ptr = klass;
(gdb) bt
#0 search_method_protect (defined_class_ptr=0x0, id=30865, klass=93824998598240) at vm_method.c:986
#1 resolve_refined_method (refinements=8, me=<optimized out>, defined_class_ptr=0x0) at vm_method.c:1256
#2 0x00005555555ad1fe in method_entry_i (key=30865, value=93824998597680, data=0x7fffffffc3d0) at class.c:1365
#3 0x00005555557b6f90 in rb_id_table_foreach (tbl=0x555555c97120, func=func@entry=0x5555555ad1b0 <method_entry_i>, data=data@entry=0x7fffffffc3d0) at symbol.c:493
#4 0x00005555555adbf7 in add_instance_method_list (me_arg=0x7fffffffc3d0, mod=93824999286960) at class.c:1386
#5 class_instance_method_list (argc=<optimized out>, argv=<optimized out>, mod=93824999286960, obj=<optimized out>, func=0x5555555ad2e0 <ins_methods_i>) at class.c:1422
#6 0x00005555558025c0 in vm_call_cfunc_with_frame (ec=0x555555b51790, reg_cfp=0x7ffff7fcafa0, calling=<optimized out>) at vm_insnhelper.c:2898
#7 0x0000555555810806 in vm_sendish (method_explorer=<optimized out>, block_handler=<optimized out>, cd=<optimized out>, reg_cfp=<optimized out>, ec=<optimized out>) at vm_callinfo.h:336
#8 vm_exec_core (ec=0x3, initial=93824998597000) at insns.def:789
#9 0x0000555555805ddf in rb_vm_exec (ec=0x555555b51790, mjit_enable_p=true) at vm.c:2163
#10 0x0000555555622006 in rb_ec_exec_node (ec=ec@entry=0x555555b51790, n=n@entry=0x555555b66b10) at eval.c:317
#11 0x00005555556269f9 in ruby_run_node (n=0x555555b66b10) at eval.c:375
#12 0x000055555558125f in main (argc=<optimized out>, argv=<optimized out>) at main.c:50
(gdb)
```
----------------------------------------
Bug #17494: ruby is hanged when using activesupport + rspec + rspec-parameterized
https://bugs.ruby-lang.org/issues/17494#change-90080
* Author: sue445 (Go Sueyoshi)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.0.0p0
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
# Example code
## Gemfile
```ruby
# frozen_string_literal: true
source "https://rubygems.org"
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
gem "activesupport", "6.1.0"
gem "rspec", "3.10.0"
gem "rspec-parameterized", "0.4.2"
```
## spec file
``` ruby
require "active_support/all"
require "rspec-parameterized"
describe "CLI" do
subject do
# Expected error, but actual hunged here
cli.foo # <- hunged here
end
it { expect { subject }.to raise_error }
end
xdescribe "GitlabMrRelease::Project" do
describe "#api_version" do
using RSpec::Parameterized::TableSyntax
where(:api_endpoint, :expected) do
"http://example.com/api/v4/" | 4
end
with_them do
# it { should eq expected }
end
end
end
```
all codes are here.
https://github.com/sue445/ruby_3_0_0_bug_report_20201231
# Expected
spec is successful (This is the behavior up to ruby 2.7.2)
# Actual
hunged at line 7
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 11+ messages in thread
* [ruby-dev:50997] [Ruby master Bug#17494] ruby is hanged when using activesupport + rspec + rspec-parameterized
2020-12-31 11:47 [ruby-dev:50988] [Ruby master Bug#17494] ruby is hunged when using activesupport + rspec + rspec-parameterized sue445fukuoka
` (3 preceding siblings ...)
2021-01-25 0:42 ` [ruby-dev:50996] " shyouhei
@ 2021-01-25 8:51 ` nobu
2021-01-26 0:45 ` [ruby-dev:50998] " nobu
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: nobu @ 2021-01-25 8:51 UTC (permalink / raw)
To: ruby-dev
Issue #17494 has been updated by nobu (Nobuyoshi Nakada).
This patch seems to avoid the loop for the time being.
```diff
diff --git i/class.c w/class.c
index a62ae669f84..61f3ece40f4 100644
--- i/class.c
+++ w/class.c
@@ -1369,7 +1369,7 @@ method_entry_i(ID key, VALUE value, void *data)
if (me->def->type == VM_METHOD_TYPE_REFINED) {
VALUE owner = me->owner;
- me = rb_resolve_refined_method(Qnil, me);
+ me = rb_method_entry_with_refinements(owner, me->called_id, NULL);
if (!me) return ID_TABLE_CONTINUE;
if (!arg->recur && me->owner != owner) return ID_TABLE_CONTINUE;
}
```
----------------------------------------
Bug #17494: ruby is hanged when using activesupport + rspec + rspec-parameterized
https://bugs.ruby-lang.org/issues/17494#change-90081
* Author: sue445 (Go Sueyoshi)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.0.0p0
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
# Example code
## Gemfile
```ruby
# frozen_string_literal: true
source "https://rubygems.org"
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
gem "activesupport", "6.1.0"
gem "rspec", "3.10.0"
gem "rspec-parameterized", "0.4.2"
```
## spec file
``` ruby
require "active_support/all"
require "rspec-parameterized"
describe "CLI" do
subject do
# Expected error, but actual hunged here
cli.foo # <- hunged here
end
it { expect { subject }.to raise_error }
end
xdescribe "GitlabMrRelease::Project" do
describe "#api_version" do
using RSpec::Parameterized::TableSyntax
where(:api_endpoint, :expected) do
"http://example.com/api/v4/" | 4
end
with_them do
# it { should eq expected }
end
end
end
```
all codes are here.
https://github.com/sue445/ruby_3_0_0_bug_report_20201231
# Expected
spec is successful (This is the behavior up to ruby 2.7.2)
# Actual
hunged at line 7
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 11+ messages in thread
* [ruby-dev:50998] [Ruby master Bug#17494] ruby is hanged when using activesupport + rspec + rspec-parameterized
2020-12-31 11:47 [ruby-dev:50988] [Ruby master Bug#17494] ruby is hunged when using activesupport + rspec + rspec-parameterized sue445fukuoka
` (4 preceding siblings ...)
2021-01-25 8:51 ` [ruby-dev:50997] " nobu
@ 2021-01-26 0:45 ` nobu
2021-01-26 5:32 ` [ruby-dev:50999] " yasuo.honda
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: nobu @ 2021-01-26 0:45 UTC (permalink / raw)
To: ruby-dev
Issue #17494 has been updated by nobu (Nobuyoshi Nakada).
The previous patch failed an assertion.
https://github.com/nobu/ruby/runs/1760739746?check_suite_focus=true#step:15:288
> | Assertion Failed: ../src/vm_method.c:990:search_method:me == NULL || !METHOD_ENTRY_INVALIDATED(me)
Maybe the real cause is an access to the invalided method entry?
----------------------------------------
Bug #17494: ruby is hanged when using activesupport + rspec + rspec-parameterized
https://bugs.ruby-lang.org/issues/17494#change-90093
* Author: sue445 (Go Sueyoshi)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.0.0p0
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
# Example code
## Gemfile
```ruby
# frozen_string_literal: true
source "https://rubygems.org"
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
gem "activesupport", "6.1.0"
gem "rspec", "3.10.0"
gem "rspec-parameterized", "0.4.2"
```
## spec file
``` ruby
require "active_support/all"
require "rspec-parameterized"
describe "CLI" do
subject do
# Expected error, but actual hunged here
cli.foo # <- hunged here
end
it { expect { subject }.to raise_error }
end
xdescribe "GitlabMrRelease::Project" do
describe "#api_version" do
using RSpec::Parameterized::TableSyntax
where(:api_endpoint, :expected) do
"http://example.com/api/v4/" | 4
end
with_them do
# it { should eq expected }
end
end
end
```
all codes are here.
https://github.com/sue445/ruby_3_0_0_bug_report_20201231
# Expected
spec is successful (This is the behavior up to ruby 2.7.2)
# Actual
hunged at line 7
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 11+ messages in thread
* [ruby-dev:50999] [Ruby master Bug#17494] ruby is hanged when using activesupport + rspec + rspec-parameterized
2020-12-31 11:47 [ruby-dev:50988] [Ruby master Bug#17494] ruby is hunged when using activesupport + rspec + rspec-parameterized sue445fukuoka
` (5 preceding siblings ...)
2021-01-26 0:45 ` [ruby-dev:50998] " nobu
@ 2021-01-26 5:32 ` yasuo.honda
2021-03-11 0:01 ` [ruby-dev:51032] " merch-redmine
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: yasuo.honda @ 2021-01-26 5:32 UTC (permalink / raw)
To: ruby-dev
Issue #17494 has been updated by yahonda (Yasuo Honda).
This minimum case hangs since https://github.com/ruby/ruby/commit/b9007b6c548f91e88fd3f2ffa23de740431fa969
* Save this minimum case as `rep17494_min.rb`, added some p method to see if it hangs or not.
```ruby
Object.prepend(Module.new)
using(Module.new {
refine Object do
def hello; end
end
})
Object.new.hello
module M
def hello; end
end
class A
include M
end
p 'Showing Object.instance_methods'
p Object.instance_methods
```
* Run this rep17494_min.rb against as of b9007b6c548f91e88fd3f2ffa23de740431fa969 using `rubylang/rubyfarm:b9007b6c548f91e88fd3f2ffa23de740431fa969` docker image
```
% docker run -it --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp rubylang/rubyfarm:b9007b6c548f91e88fd3f2ffa23de740431fa969 ruby rep17494_min.rb
"Showing Object.instance_methods"
```
It hangs at `p Object.instance_methods`.
* Run this rep17494_min.rb against as of f2286925f08406bc857f7b03ad6779a5d61443ae, which is the parent commit of b9007b6c548f91e88fd3f2ffa23de740431fa969
```
% docker run -it --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp rubylang/rubyfarm:f2286925f08406bc857f7b03ad6779a5d61443ae ruby rep17494_min.rb
"Showing Object.instance_methods"
[:dup, :itself, :yield_self, :then, :taint, :tainted?, :untaint, :untrust, :untrusted?, :trust, :frozen?, :methods, :singleton_methods, :protected_methods, :private_methods, :public_methods, :instance_variables, :instance_variable_get, :instance_variable_set, :instance_variable_defined?, :remove_instance_variable, :instance_of?, :kind_of?, :is_a?, :tap, :singleton_class, :clone, :public_send, :method, :public_method, :singleton_method, :define_singleton_method, :extend, :<=>, :to_enum, :enum_for, :===, :=~, :!~, :nil?, :eql?, :respond_to?, :freeze, :inspect, :object_id, :send, :to_s, :display, :class, :hash, :__send__, :!, :__id__, :==, :!=, :equal?, :instance_eval, :instance_exec]
```
It shows the result of `p Object.instance_methods`.
These steps do not require Docker if each Ruby build is available locally.
----------------------------------------
Bug #17494: ruby is hanged when using activesupport + rspec + rspec-parameterized
https://bugs.ruby-lang.org/issues/17494#change-90099
* Author: sue445 (Go Sueyoshi)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.0.0p0
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
# Example code
## Gemfile
```ruby
# frozen_string_literal: true
source "https://rubygems.org"
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
gem "activesupport", "6.1.0"
gem "rspec", "3.10.0"
gem "rspec-parameterized", "0.4.2"
```
## spec file
``` ruby
require "active_support/all"
require "rspec-parameterized"
describe "CLI" do
subject do
# Expected error, but actual hunged here
cli.foo # <- hunged here
end
it { expect { subject }.to raise_error }
end
xdescribe "GitlabMrRelease::Project" do
describe "#api_version" do
using RSpec::Parameterized::TableSyntax
where(:api_endpoint, :expected) do
"http://example.com/api/v4/" | 4
end
with_them do
# it { should eq expected }
end
end
end
```
all codes are here.
https://github.com/sue445/ruby_3_0_0_bug_report_20201231
# Expected
spec is successful (This is the behavior up to ruby 2.7.2)
# Actual
hunged at line 7
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 11+ messages in thread
* [ruby-dev:51032] [Ruby master Bug#17494] ruby is hanged when using activesupport + rspec + rspec-parameterized
2020-12-31 11:47 [ruby-dev:50988] [Ruby master Bug#17494] ruby is hunged when using activesupport + rspec + rspec-parameterized sue445fukuoka
` (6 preceding siblings ...)
2021-01-26 5:32 ` [ruby-dev:50999] " yasuo.honda
@ 2021-03-11 0:01 ` merch-redmine
2021-07-01 21:44 ` [ruby-dev:51074] " merch-redmine
2021-07-03 3:15 ` [ruby-dev:51075] " nagachika00
9 siblings, 0 replies; 11+ messages in thread
From: merch-redmine @ 2021-03-11 0:01 UTC (permalink / raw)
To: ruby-dev
Issue #17494 has been updated by jeremyevans0 (Jeremy Evans).
One possible workaround for this is a checking for an immediate loop in `resolve_refined_method`:
```diff
diff --git a/vm_method.c b/vm_method.c
index 2573e708ba..ebfe686a27 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -1245,7 +1245,7 @@ resolve_refined_method(VALUE refinements, const rb_method_entry_t *me, VALUE *de
{
while (me && me->def->type == VM_METHOD_TYPE_REFINED) {
VALUE refinement;
- const rb_method_entry_t *tmp_me;
+ const rb_method_entry_t *tmp_me, *prev_me = me;
VALUE super;
refinement = find_refinement(refinements, me->owner);
@@ -1269,6 +1269,9 @@ resolve_refined_method(VALUE refinements, const rb_method_entry_t *me, VALUE *de
}
me = search_method_protect(super, me->called_id, defined_class_ptr);
+ if (me == prev_me) {
+ return 0;
+ }
}
return me;
}
```
This fixes the case in the example, but maybe there are other more complex cases that it wouldn't catch. However, even if it won't catch all cases, until we have solved the underlying issue, this seems like a reasonable thing to add. I can submit a pull request for this if other committers are in favor.
----------------------------------------
Bug #17494: ruby is hanged when using activesupport + rspec + rspec-parameterized
https://bugs.ruby-lang.org/issues/17494#change-90873
* Author: sue445 (Go Sueyoshi)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.0.0p0
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
# Example code
## Gemfile
```ruby
# frozen_string_literal: true
source "https://rubygems.org"
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
gem "activesupport", "6.1.0"
gem "rspec", "3.10.0"
gem "rspec-parameterized", "0.4.2"
```
## spec file
``` ruby
require "active_support/all"
require "rspec-parameterized"
describe "CLI" do
subject do
# Expected error, but actual hunged here
cli.foo # <- hunged here
end
it { expect { subject }.to raise_error }
end
xdescribe "GitlabMrRelease::Project" do
describe "#api_version" do
using RSpec::Parameterized::TableSyntax
where(:api_endpoint, :expected) do
"http://example.com/api/v4/" | 4
end
with_them do
# it { should eq expected }
end
end
end
```
all codes are here.
https://github.com/sue445/ruby_3_0_0_bug_report_20201231
# Expected
spec is successful (This is the behavior up to ruby 2.7.2)
# Actual
hunged at line 7
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 11+ messages in thread
* [ruby-dev:51074] [Ruby master Bug#17494] ruby is hanged when using activesupport + rspec + rspec-parameterized
2020-12-31 11:47 [ruby-dev:50988] [Ruby master Bug#17494] ruby is hunged when using activesupport + rspec + rspec-parameterized sue445fukuoka
` (7 preceding siblings ...)
2021-03-11 0:01 ` [ruby-dev:51032] " merch-redmine
@ 2021-07-01 21:44 ` merch-redmine
2021-07-03 3:15 ` [ruby-dev:51075] " nagachika00
9 siblings, 0 replies; 11+ messages in thread
From: merch-redmine @ 2021-07-01 21:44 UTC (permalink / raw)
To: ruby-dev
Issue #17494 has been updated by jeremyevans0 (Jeremy Evans).
Backport changed from 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN to 2.6: DONTNEED, 2.7: DONTNEED, 3.0: REQUIRED
Status changed from Open to Closed
This issue has been fixed in the master branch. I bisected the fixing commit to commit:39a2ba5cc559900c30c3143da32446c2f20a7484. This issue exists in Ruby 3.0 but not in Ruby 2.7 or 2.6, so if possible, this should be backported to 3.0.
----------------------------------------
Bug #17494: ruby is hanged when using activesupport + rspec + rspec-parameterized
https://bugs.ruby-lang.org/issues/17494#change-92721
* Author: sue445 (Go Sueyoshi)
* Status: Closed
* Priority: Normal
* ruby -v: ruby 3.0.0p0
* Backport: 2.6: DONTNEED, 2.7: DONTNEED, 3.0: REQUIRED
----------------------------------------
# Example code
## Gemfile
```ruby
# frozen_string_literal: true
source "https://rubygems.org"
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
gem "activesupport", "6.1.0"
gem "rspec", "3.10.0"
gem "rspec-parameterized", "0.4.2"
```
## spec file
``` ruby
require "active_support/all"
require "rspec-parameterized"
describe "CLI" do
subject do
# Expected error, but actual hunged here
cli.foo # <- hunged here
end
it { expect { subject }.to raise_error }
end
xdescribe "GitlabMrRelease::Project" do
describe "#api_version" do
using RSpec::Parameterized::TableSyntax
where(:api_endpoint, :expected) do
"http://example.com/api/v4/" | 4
end
with_them do
# it { should eq expected }
end
end
end
```
all codes are here.
https://github.com/sue445/ruby_3_0_0_bug_report_20201231
# Expected
spec is successful (This is the behavior up to ruby 2.7.2)
# Actual
hunged at line 7
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 11+ messages in thread
* [ruby-dev:51075] [Ruby master Bug#17494] ruby is hanged when using activesupport + rspec + rspec-parameterized
2020-12-31 11:47 [ruby-dev:50988] [Ruby master Bug#17494] ruby is hunged when using activesupport + rspec + rspec-parameterized sue445fukuoka
` (8 preceding siblings ...)
2021-07-01 21:44 ` [ruby-dev:51074] " merch-redmine
@ 2021-07-03 3:15 ` nagachika00
9 siblings, 0 replies; 11+ messages in thread
From: nagachika00 @ 2021-07-03 3:15 UTC (permalink / raw)
To: ruby-dev
Issue #17494 has been updated by nagachika (Tomoyuki Chikanaga).
Backport changed from 2.6: DONTNEED, 2.7: DONTNEED, 3.0: REQUIRED to 2.6: DONTNEED, 2.7: DONTNEED, 3.0: DONE
Thank you for your investigations.
39a2ba5cc559900c30c3143da32446c2f20a7484 was already backported at d47df50678b00bd622e6be474031204ed2e52b31.
See https://bugs.ruby-lang.org/issues/17806 too.
I will fill the Backport field with "3.0: DONE".
----------------------------------------
Bug #17494: ruby is hanged when using activesupport + rspec + rspec-parameterized
https://bugs.ruby-lang.org/issues/17494#change-92738
* Author: sue445 (Go Sueyoshi)
* Status: Closed
* Priority: Normal
* ruby -v: ruby 3.0.0p0
* Backport: 2.6: DONTNEED, 2.7: DONTNEED, 3.0: DONE
----------------------------------------
# Example code
## Gemfile
```ruby
# frozen_string_literal: true
source "https://rubygems.org"
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
gem "activesupport", "6.1.0"
gem "rspec", "3.10.0"
gem "rspec-parameterized", "0.4.2"
```
## spec file
``` ruby
require "active_support/all"
require "rspec-parameterized"
describe "CLI" do
subject do
# Expected error, but actual hunged here
cli.foo # <- hunged here
end
it { expect { subject }.to raise_error }
end
xdescribe "GitlabMrRelease::Project" do
describe "#api_version" do
using RSpec::Parameterized::TableSyntax
where(:api_endpoint, :expected) do
"http://example.com/api/v4/" | 4
end
with_them do
# it { should eq expected }
end
end
end
```
all codes are here.
https://github.com/sue445/ruby_3_0_0_bug_report_20201231
# Expected
spec is successful (This is the behavior up to ruby 2.7.2)
# Actual
hunged at line 7
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2021-07-03 3:15 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-31 11:47 [ruby-dev:50988] [Ruby master Bug#17494] ruby is hunged when using activesupport + rspec + rspec-parameterized sue445fukuoka
2021-01-01 7:34 ` [ruby-dev:50989] [Ruby master Bug#17494] ruby is hanged " yasuo.honda
2021-01-22 5:41 ` [ruby-dev:50991] " sue445fukuoka
2021-01-22 16:32 ` [ruby-dev:50992] " alpaca-tc
2021-01-25 0:42 ` [ruby-dev:50996] " shyouhei
2021-01-25 8:51 ` [ruby-dev:50997] " nobu
2021-01-26 0:45 ` [ruby-dev:50998] " nobu
2021-01-26 5:32 ` [ruby-dev:50999] " yasuo.honda
2021-03-11 0:01 ` [ruby-dev:51032] " merch-redmine
2021-07-01 21:44 ` [ruby-dev:51074] " merch-redmine
2021-07-03 3:15 ` [ruby-dev:51075] " nagachika00
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).