Project

General

Profile

Bug #2051

alias_method :foo, :__send__

Added by mattetti (Matt Aimonetti) about 11 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
ruby -v:
ruby 1.9.2dev (2009-07-18) [i386-darwin10.0.0]
Backport:
[ruby-core:25390]

Description

=begin
This is a bug that can be experienced when using Rails' ActiveSupport and Ruby 1.9.2:
activesupport/lib/active_support/core_ext/try.rb:29

$ ruby1.9 -e "class Object; alias_method :foo, :send; end "
-e:1: [BUG] rb_add_method: unsupported method type (8)

ruby 1.9.2dev (2009-07-18) [i386-darwin10.0.0]

-- control frame ----------
c:0005 p:---- s:0013 b:0013 l:000012 d:000012 CFUNC :alias_method
c:0004 p:0015 s:0008 b:0008 l:000007 d:000007 CLASS -e:1
c:0003 p:0009 s:0006 b:0006 l:002358 d:0019c8 EVAL -e:1
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:002358 d:002358 TOP


-e:1:in <main>'
-e:1:in
class:Object'
-e:1:in `alias_method'

-- C level backtrace information -------------------------------------------
0 libruby.1.9.1.dylib 0x00000001001605d3 rb_vm_bugreport + 195
1 libruby.1.9.1.dylib 0x00000001000367c4 report_bug + 372
2 libruby.1.9.1.dylib 0x0000000100036988 rb_bug + 200
3 libruby.1.9.1.dylib 0x000000010015932f rb_alias + 319
4 libruby.1.9.1.dylib 0x000000010015956b rb_mod_alias_method + 59
5 libruby.1.9.1.dylib 0x0000000100148a42 vm_call_cfunc + 354
6 libruby.1.9.1.dylib 0x000000010015d6c4 vm_call_method + 1268
7 libruby.1.9.1.dylib 0x000000010014df94 vm_exec_core + 4452
8 libruby.1.9.1.dylib 0x0000000100154e4e vm_exec + 1102
9 libruby.1.9.1.dylib 0x00000001001550b0 rb_iseq_eval_main + 464
10 libruby.1.9.1.dylib 0x000000010003a272 ruby_exec_node + 178
11 libruby.1.9.1.dylib 0x000000010003c0f4 ruby_run_node + 84
12 ruby1.9 0x0000000100000ecf main + 79
13 ruby1.9 0x0000000100000e74 start + 52

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

Abort trap

The same code was executing properly in Ruby 1.8.7
=end


Related issues

Has duplicate Ruby master - Bug #2577: Ruby 1.9.2 Preview 1 Aborts when script/generate is usedClosed01/08/2010Actions
#1

Updated by mattetti (Matt Aimonetti) about 11 years ago

=begin
Looks like a regression, I tried on a different machine:

$ruby19 -e "class Object; alias_method :foo, :send; end; p 'test'.foo(:upcase) "
"TEST"
$ ruby19 -v
ruby 1.9.2dev (2009-07-02 trunk 23934)[i386-darwin10.0.0]
=end

#2

Updated by wycats (Yehuda Katz) about 11 years ago

=begin
I can reproduce on 1.9 trunk:

$ ruby -e "class Object; alias_method :try, :send; end "
-e:1: [BUG] rb_add_method: unsupported method type (8)

ruby 1.9.2dev (2009-07-18 trunk 24186) [i386-darwin10.0.0]

-- control frame ----------
c:0005 p:---- s:0013 b:0013 l:000012 d:000012 CFUNC :alias_method
c:0004 p:0015 s:0008 b:0008 l:000007 d:000007 CLASS -e:1
c:0003 p:0009 s:0006 b:0006 l:002348 d:000668 EVAL -e:1
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:002348 d:002348 TOP


-e:1:in <main>'
-e:1:in
class:Object'
-e:1:in `alias_method'

-- C level backtrace information -------------------------------------------
0 ruby 0x000000010015d153 rb_vm_bugreport + 195
1 ruby 0x0000000100034114 report_bug + 372
2 ruby 0x00000001000342d8 rb_bug + 200
3 ruby 0x0000000100155eaf rb_alias + 319
4 ruby 0x00000001001560eb rb_mod_alias_method + 59
5 ruby 0x0000000100145552 vm_call_cfunc + 354
6 ruby 0x000000010015a244 vm_call_method + 1268
7 ruby 0x000000010014aaa4 vm_exec_core + 4452
8 ruby 0x00000001001519ce vm_exec + 1102
9 ruby 0x0000000100151c30 rb_iseq_eval_main + 464
10 ruby 0x0000000100037be2 ruby_exec_node + 178
11 ruby 0x0000000100039a64 ruby_run_node + 84
12 ruby 0x00000001000014cf main + 79
13 ruby 0x00000001000014
=end

#3

Updated by nobu (Nobuyoshi Nakada) about 11 years ago

  • Status changed from Open to Closed

=begin
Already fixed.
=end

Also available in: Atom PDF