ruby-dev (Japanese) list archive (unofficial mirror)
 help / color / mirror / Atom feed
From: yasuo.honda@gmail.com
To: ruby-dev@ruby-lang.org
Subject: [ruby-dev:50999] [Ruby master Bug#17494] ruby is hanged when using activesupport + rspec + rspec-parameterized
Date: Tue, 26 Jan 2021 05:32:21 +0000 (UTC)	[thread overview]
Message-ID: <redmine.journal-90099.20210126053220.17960@ruby-lang.org> (raw)
In-Reply-To: <redmine.issue-17494.20201231114745.17960@ruby-lang.org>

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/

  parent reply	other threads:[~2021-01-26  5:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-31 11:47 [ruby-dev:50988] [Ruby master Bug#17494] ruby is hunged " 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 ` yasuo.honda [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=redmine.journal-90099.20210126053220.17960@ruby-lang.org \
    --to=yasuo.honda@gmail.com \
    --cc=ruby-dev@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).