From: Nobuyoshi Nakada Date: 2009-03-11T18:40:15+09:00 Subject: [ruby-dev:38150] [Bug #1267] DL::Handle#sym segfaults with nil Bug #1267: DL::Handle#sym segfaults with nil http://redmine.ruby-lang.org/issues/show/1267 起票者: Nobuyoshi Nakada ステータス: Open, 優先度: Normal カテゴリ: ext, Target version: 1.9.1 ruby -v: ruby 1.9.2dev (2009-03-11 trunk 22881) [i386-darwin9.0] DL::Handle#symにシンボル名としてnilを渡すと代わりにRTLD_NEXTを使 うようになっていますが、RTLD_NEXTが渡せるのはシンボル名ではなく て第一引数のハンドルのほうです。 ハンドルに該当するのはselfですが、もちろんnilは渡しようができな いのでクラスメソッドを定義するのはどうでしょうか。 $ ruby -rdl -e 'p DL::Handle.new("libc.dylib").sym(nil)' -e:1: [BUG] Segmentation fault ruby 1.9.2dev (2009-03-11 trunk 22881) [i386-darwin9.0] -- control frame ---------- c:0004 p:---- s:0011 b:0011 l:000010 d:000010 CFUNC :sym c:0003 p:0027 s:0007 b:0006 l:001fc4 d:001d84 EVAL -e:1 c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH c:0001 p:0000 s:0002 b:0002 l:001fc4 d:001fc4 TOP
:45920 --------------------------- -e:1:in `
' -e:1:in `sym' -- C level backtrace information ------------------------------------------- [NOTE] You may have encountered a bug in the Ruby interpreter. Bug reports are welcome. For details: http://www.ruby-lang.org/bugreport.html Abort trap ---------------------------------------- http://redmine.ruby-lang.org