ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:91916] [Ruby trunk Bug#15720] SystemStackError when referencing a refinement in a module that isn't used
       [not found] <redmine.issue-15720.20190321200722@ruby-lang.org>
@ 2019-03-21 20:07 ` chocolate
  2019-06-10 23:27 ` [ruby-core:93038] " merch-redmine
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: chocolate @ 2019-03-21 20:07 UTC (permalink / raw
  To: ruby-core

Issue #15720 has been reported by chocolateboy (Art Vandelay).

----------------------------------------
Bug #15720: SystemStackError when referencing a refinement in a module that isn't used
https://bugs.ruby-lang.org/issues/15720

* Author: chocolateboy (Art Vandelay)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.7.0dev (2019-03-21 trunk 67332) [x86_64-linux]
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
```ruby
module M1
  refine Kernel do
    def foo
      'foo called!'
    end
  end
end

module M2
  refine Kernel do
    def bar
      'bar called!'
    end
  end
end

using M1

puts foo
puts bar
```

Expected:

```
foo called!
Traceback (most recent call last):
bug.rb:22:in `<main>': undefined local variable or method `bar' for main:Object (NameError)
```

Actual:

```
foo called!
Traceback (most recent call last):
bug.rb:22:in `<main>': stack level too deep (SystemStackError)
```

Same result on:

- ruby 2.6.2p47 (2019-03-13 revision 67232) [x86_64-linux]
- ruby 2.7.0dev (2019-03-21 trunk 67332) [x86_64-linux]

---Files--------------------------------
bug.rb (188 Bytes)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:93038] [Ruby trunk Bug#15720] SystemStackError when referencing a refinement in a module that isn't used
       [not found] <redmine.issue-15720.20190321200722@ruby-lang.org>
  2019-03-21 20:07 ` [ruby-core:91916] [Ruby trunk Bug#15720] SystemStackError when referencing a refinement in a module that isn't used chocolate
@ 2019-06-10 23:27 ` merch-redmine
  2019-06-11  9:03 ` [ruby-core:93040] " nobu
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: merch-redmine @ 2019-06-10 23:27 UTC (permalink / raw
  To: ruby-core

Issue #15720 has been updated by jeremyevans0 (Jeremy Evans).

Assignee set to ko1 (Koichi Sasada)
Status changed from Open to Assigned
File sse-unused-refinement.patch added

I can confirm this issue.  I believe it stems from the fact that in `vm_call_method_each_type`, `cc->me` is getting overwritten by `ref_me` even if they already have the same `def` but a different `defined_class`, which results in infinite recursion.  The attached patch should fix your example, but my understanding of this code is limited.  ko1 or shugo should probably review this patch and determine if it is the proper way to fix this issue.  This could possibly be related to #14068.

----------------------------------------
Bug #15720: SystemStackError when referencing a refinement in a module that isn't used
https://bugs.ruby-lang.org/issues/15720#change-78424

* Author: chocolateboy (Chocolate Boy)
* Status: Assigned
* Priority: Normal
* Assignee: ko1 (Koichi Sasada)
* Target version: 
* ruby -v: ruby 2.7.0dev (2019-03-21 trunk 67332) [x86_64-linux]
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
```ruby
module M1
  refine Kernel do
    def foo
      'foo called!'
    end
  end
end

module M2
  refine Kernel do
    def bar
      'bar called!'
    end
  end
end

using M1

puts foo
puts bar
```

Expected:

```
foo called!
Traceback (most recent call last):
bug.rb:20:in `<main>': undefined local variable or method `bar' for main:Object (NameError)
```

Actual:

```
foo called!
Traceback (most recent call last):
bug.rb:20:in `<main>': stack level too deep (SystemStackError)
```

Platform: Linux (Arch)

ruby -v:

- ruby 2.7.0dev (2019-03-21 trunk 67332) [x86_64-linux]
- ruby 2.6.2p47 (2019-03-13 revision 67232) [x86_64-linux]
- ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux]

---Files--------------------------------
bug.rb (188 Bytes)
sse-unused-refinement.patch (1.85 KB)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:93040] [Ruby trunk Bug#15720] SystemStackError when referencing a refinement in a module that isn't used
       [not found] <redmine.issue-15720.20190321200722@ruby-lang.org>
  2019-03-21 20:07 ` [ruby-core:91916] [Ruby trunk Bug#15720] SystemStackError when referencing a refinement in a module that isn't used chocolate
  2019-06-10 23:27 ` [ruby-core:93038] " merch-redmine
@ 2019-06-11  9:03 ` nobu
  2019-08-05 14:06 ` [ruby-core:94148] [Ruby master " nagachika00
  2019-08-26 15:40 ` [ruby-core:94574] " usa
  4 siblings, 0 replies; 5+ messages in thread
From: nobu @ 2019-06-11  9:03 UTC (permalink / raw
  To: ruby-core

Issue #15720 has been updated by nobu (Nobuyoshi Nakada).


Seems fine.
Just rename `test_refining_module_repeatedly` which redefines an existing method.

----------------------------------------
Bug #15720: SystemStackError when referencing a refinement in a module that isn't used
https://bugs.ruby-lang.org/issues/15720#change-78431

* Author: chocolateboy (Chocolate Boy)
* Status: Assigned
* Priority: Normal
* Assignee: ko1 (Koichi Sasada)
* Target version: 
* ruby -v: ruby 2.7.0dev (2019-03-21 trunk 67332) [x86_64-linux]
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
```ruby
module M1
  refine Kernel do
    def foo
      'foo called!'
    end
  end
end

module M2
  refine Kernel do
    def bar
      'bar called!'
    end
  end
end

using M1

puts foo
puts bar
```

Expected:

```
foo called!
Traceback (most recent call last):
bug.rb:20:in `<main>': undefined local variable or method `bar' for main:Object (NameError)
```

Actual:

```
foo called!
Traceback (most recent call last):
bug.rb:20:in `<main>': stack level too deep (SystemStackError)
```

Platform: Linux (Arch)

ruby -v:

- ruby 2.7.0dev (2019-03-21 trunk 67332) [x86_64-linux]
- ruby 2.6.2p47 (2019-03-13 revision 67232) [x86_64-linux]
- ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux]

---Files--------------------------------
bug.rb (188 Bytes)
sse-unused-refinement.patch (1.85 KB)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:94148] [Ruby master Bug#15720] SystemStackError when referencing a refinement in a module that isn't used
       [not found] <redmine.issue-15720.20190321200722@ruby-lang.org>
                   ` (2 preceding siblings ...)
  2019-06-11  9:03 ` [ruby-core:93040] " nobu
@ 2019-08-05 14:06 ` nagachika00
  2019-08-26 15:40 ` [ruby-core:94574] " usa
  4 siblings, 0 replies; 5+ messages in thread
From: nagachika00 @ 2019-08-05 14:06 UTC (permalink / raw
  To: ruby-core

Issue #15720 has been updated by nagachika (Tomoyuki Chikanaga).

Backport changed from 2.4: UNKNOWN, 2.5: REQUIRED, 2.6: REQUIRED to 2.4: UNKNOWN, 2.5: REQUIRED, 2.6: DONE

ruby_2_6 r67729 merged revision(s) 5e018214e7435030727a97ac49db038d96438e74.

----------------------------------------
Bug #15720: SystemStackError when referencing a refinement in a module that isn't used
https://bugs.ruby-lang.org/issues/15720#change-80394

* Author: chocolateboy (Chocolate Boy)
* Status: Closed
* Priority: Normal
* Assignee: ko1 (Koichi Sasada)
* Target version: 
* ruby -v: ruby 2.7.0dev (2019-03-21 trunk 67332) [x86_64-linux]
* Backport: 2.4: UNKNOWN, 2.5: REQUIRED, 2.6: DONE
----------------------------------------
```ruby
module M1
  refine Kernel do
    def foo
      'foo called!'
    end
  end
end

module M2
  refine Kernel do
    def bar
      'bar called!'
    end
  end
end

using M1

puts foo
puts bar
```

Expected:

```
foo called!
Traceback (most recent call last):
bug.rb:20:in `<main>': undefined local variable or method `bar' for main:Object (NameError)
```

Actual:

```
foo called!
Traceback (most recent call last):
bug.rb:20:in `<main>': stack level too deep (SystemStackError)
```

Platform: Linux (Arch)

ruby -v:

- ruby 2.7.0dev (2019-03-21 trunk 67332) [x86_64-linux]
- ruby 2.6.2p47 (2019-03-13 revision 67232) [x86_64-linux]
- ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux]

---Files--------------------------------
bug.rb (188 Bytes)
sse-unused-refinement.patch (1.85 KB)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:94574] [Ruby master Bug#15720] SystemStackError when referencing a refinement in a module that isn't used
       [not found] <redmine.issue-15720.20190321200722@ruby-lang.org>
                   ` (3 preceding siblings ...)
  2019-08-05 14:06 ` [ruby-core:94148] [Ruby master " nagachika00
@ 2019-08-26 15:40 ` usa
  4 siblings, 0 replies; 5+ messages in thread
From: usa @ 2019-08-26 15:40 UTC (permalink / raw
  To: ruby-core

Issue #15720 has been updated by usa (Usaku NAKAMURA).

Backport changed from 2.4: UNKNOWN, 2.5: REQUIRED, 2.6: DONE to 2.4: UNKNOWN, 2.5: DONE, 2.6: DONE

ruby_2_5 r67765 merged revision(s) 5e018214e7435030727a97ac49db038d96438e74.

----------------------------------------
Bug #15720: SystemStackError when referencing a refinement in a module that isn't used
https://bugs.ruby-lang.org/issues/15720#change-81032

* Author: chocolateboy (Chocolate Boy)
* Status: Closed
* Priority: Normal
* Assignee: ko1 (Koichi Sasada)
* Target version: 
* ruby -v: ruby 2.7.0dev (2019-03-21 trunk 67332) [x86_64-linux]
* Backport: 2.4: UNKNOWN, 2.5: DONE, 2.6: DONE
----------------------------------------
```ruby
module M1
  refine Kernel do
    def foo
      'foo called!'
    end
  end
end

module M2
  refine Kernel do
    def bar
      'bar called!'
    end
  end
end

using M1

puts foo
puts bar
```

Expected:

```
foo called!
Traceback (most recent call last):
bug.rb:20:in `<main>': undefined local variable or method `bar' for main:Object (NameError)
```

Actual:

```
foo called!
Traceback (most recent call last):
bug.rb:20:in `<main>': stack level too deep (SystemStackError)
```

Platform: Linux (Arch)

ruby -v:

- ruby 2.7.0dev (2019-03-21 trunk 67332) [x86_64-linux]
- ruby 2.6.2p47 (2019-03-13 revision 67232) [x86_64-linux]
- ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux]

---Files--------------------------------
bug.rb (188 Bytes)
sse-unused-refinement.patch (1.85 KB)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-08-26 15:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <redmine.issue-15720.20190321200722@ruby-lang.org>
2019-03-21 20:07 ` [ruby-core:91916] [Ruby trunk Bug#15720] SystemStackError when referencing a refinement in a module that isn't used chocolate
2019-06-10 23:27 ` [ruby-core:93038] " merch-redmine
2019-06-11  9:03 ` [ruby-core:93040] " nobu
2019-08-05 14:06 ` [ruby-core:94148] [Ruby master " nagachika00
2019-08-26 15:40 ` [ruby-core:94574] " usa

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 read-only IMAP folder(s) and NNTP newsgroup(s).