Bug #1788
closedある種のメソッドをalias_methodしようとすると落ちる
Description
=begin
Ruby 1.9.2 preview1で Ruby on RailsのActiveSupportのtry.rbをロードすると異常終了します。
再現コードはこんな感じです。
class Object
def try(method, *args, &block)
send(method, *args, &block)
end
remove_method :try
alias_method :try, :send
end
エラー内容は以下のとおりです。
/Users/matsuda/ruby_192/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support/core_ext/try.rb:29: [BUG] rb_add_method: unsupported method type (8)
ruby 1.9.2dev (2009-07-18 trunk 24186) [i386-darwin9.7.0]
-- control frame ----------
c:0036 p:---- s:0101 b:0101 l:000100 d:000100 CFUNC :alias_method
c:0035 p:0044 s:0096 b:0096 l:000095 d:000095 CLASS /Users/matsuda/ruby_192/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support/core_ext/try.rb:29
c:0034 p:0009 s:0094 b:0094 l:000093 d:000093 TOP /Users/matsuda/ruby_192/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support/core_ext/try.rb:1
c:0033 p:---- s:0092 b:0092 l:000091 d:000091 FINISH
c:0032 p:---- s:0090 b:0090 l:000089 d:000089 CFUNC :require
c:0031 p:0040 s:0086 b:0086 l:000076 d:000085 BLOCK /Users/matsuda/ruby_192/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support/core_ext.rb:3
c:0030 p:---- s:0082 b:0082 l:000081 d:000081 FINISH
c:0029 p:---- s:0080 b:0080 l:000079 d:000079 CFUNC :each
c:0028 p:0040 s:0077 b:0077 l:000076 d:000076 TOP /Users/matsuda/ruby_192/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support/core_ext.rb:1
c:0027 p:---- s:0075 b:0075 l:000074 d:000074 FINISH
c:0026 p:---- s:0073 b:0073 l:000072 d:000072 CFUNC :require
c:0025 p:0033 s:0069 b:0069 l:000068 d:000068 TOP /Users/matsuda/ruby_192/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support.rb:55
c:0024 p:---- s:0067 b:0067 l:000066 d:000066 FINISH
c:0023 p:---- s:0065 b:0065 l:000064 d:000064 CFUNC :require
c:0022 p:0075 s:0061 b:0061 l:001544 d:001544 TOP /Users/matsuda/ruby_192/lib/ruby/gems/1.9.1/gems/rails-2.3.2/lib/tasks/misc.rake:18
c:0021 p:---- s:0059 b:0059 l:000058 d:000058 FINISH
c:0020 p:---- s:0057 b:0057 l:000056 d:000056 CFUNC :load
c:0019 p:0012 s:0053 b:0053 l:000044 d:000052 BLOCK /Users/matsuda/ruby_192/lib/ruby/gems/1.9.1/gems/rails-2.3.2/lib/tasks/rails.rb:4
c:0018 p:---- s:0050 b:0050 l:000049 d:000049 FINISH
c:0017 p:---- s:0048 b:0048 l:000047 d:000047 CFUNC :each
c:0016 p:0043 s:0045 b:0045 l:000044 d:000044 TOP /Users/matsuda/ruby_192/lib/ruby/gems/1.9.1/gems/rails-2.3.2/lib/tasks/rails.rb:4
c:0015 p:---- s:0043 b:0043 l:000042 d:000042 FINISH
c:0014 p:---- s:0041 b:0041 l:000040 d:000040 CFUNC :require
c:0013 p:0089 s:0037 b:0037 l:000036 d:000036 TOP /Users/matsuda/work/src/rails/192/Rakefile:10
c:0012 p:---- s:0035 b:0035 l:000034 d:000034 FINISH
c:0011 p:---- s:0033 b:0033 l:000032 d:000032 CFUNC :load
c:0010 p:0335 s:0029 b:0029 l:000028 d:000028 METHOD /Users/matsuda/ruby_192/lib/ruby/1.9.1/rake.rb:2348
c:0009 p:0009 s:0024 b:0024 l:000017 d:000023 BLOCK /Users/matsuda/ruby_192/lib/ruby/1.9.1/rake.rb:1982
c:0008 p:0009 s:0022 b:0022 l:000021 d:000021 METHOD /Users/matsuda/ruby_192/lib/ruby/1.9.1/rake.rb:2033
c:0007 p:0011 s:0018 b:0018 l:000017 d:000017 METHOD /Users/matsuda/ruby_192/lib/ruby/1.9.1/rake.rb:1981
c:0006 p:0019 s:0015 b:0015 l:000008 d:000014 BLOCK /Users/matsuda/ruby_192/lib/ruby/1.9.1/rake.rb:1965
c:0005 p:0009 s:0013 b:0013 l:000012 d:000012 METHOD /Users/matsuda/ruby_192/lib/ruby/1.9.1/rake.rb:2033
c:0004 p:0011 s:0009 b:0009 l:000008 d:000008 METHOD /Users/matsuda/ruby_192/lib/ruby/1.9.1/rake.rb:1963
c:0003 p:0036 s:0006 b:0006 l:001f64 d:000454 EVAL /Users/matsuda/bin/rake:31
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:001f64 d:001f64 TOP
=end
Files
Updated by nobu (Nobuyoshi Nakada) over 15 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
=begin
Applied in changeset r24201.
=end
Updated by byrnejb (James Byrne) over 14 years ago
- File traceback.txt traceback.txt added
=begin
I am seeing this bug [BUG] rb_add_method: unsupported method type (8) in ActiveSupport-2.3.5
$ etl
/home/byrnejb/projects/proforma.git/vendor/plugins/activewarehouse-etl/lib/etl.rb:36: warning: already initialized constant VERSION
/home/byrnejb/.rvm/gems/ruby-1.9.2-preview1/gems/activesupport-2.3.5/lib/active_support/core_ext/try.rb:29: [BUG] rb_add_method: unsupported method type (8)
ruby 1.9.2dev (2009-07-18 trunk 24186) [x86_64-linux]
-- control frame ----------
c:0020 p:---- s:0054 b:0054 l:000053 d:000053 CFUNC :alias_method
c:0019 p:0044 s:0049 b:0049 l:000048 d:000048 CLASS /home/byrnejb/.rvm/gems/ruby-1.9.2-preview1/gems/activesupport-2.3.5/lib/active_support/core_ext/try.rb:29
c:0018 p:0009 s:0047 b:0047 l:000046 d:000046 TOP /home/byrnejb/.rvm/gems/ruby-1.9.2-preview1/gems/activesupport-2.3.5/lib/active_support/core_ext/try.rb:1
c:0017 p:---- s:0045 b:0045 l:000044 d:000044 FINISH
c:0016 p:---- s:0043 b:0043 l:000042 d:000042 CFUNC :require
Full back trace attached.
=end
Updated by mame (Yusuke Endoh) over 14 years ago
=begin
Hi,
This issue was reported and fixed at r24201 (2009-07-19).
You are using "ruby 1.9.2dev (2009-07-18 trunk 24186) [x86_64-linux]"
Can you reproduce with recent trunk?
--
Yusuke Endoh mame@tsg.ne.jp
=end