Issue #10170 has been updated by Igor Grebennikov.


Okay, ruby 2.1.2 gives 
 `abort (core dumped)`

for
  `A.new.a`
 in pry, irb and `ruby -e 'class A; define_method :a do; a; end; end; A.new.a'`


----------------------------------------
Bug #10170: Core dumped when using recursion in define_method
https://bugs.ruby-lang.org/issues/10170#change-48504

* Author: Igor Grebennikov
* Status: Feedback
* Priority: Normal
* Assignee: 
* Category: 
* Target version: 
* ruby -v: 2.0.0p247, 2.0.0p353, 
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
So if we have this

```ruby
class A
  define_method :a do
    a
  end
end
```

and call `A.new.a` we got `SystemStackError`
but with alias

```ruby
class A
  define_method :a do
    a
  end
end
```

when calling 

```ruby
x=A.new
x.a
```
in irb or 

```ruby
x=A.new
x.a; x.a
```
in pry  gives 

`segmentation fault (core dumped)`

But `ruby -e 'class A; define_method :a do; a; end; end; A.new.a;'`
gives segfault randomly
Ubuntu 13.10



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