Project

General

Profile

Actions

Bug #1267

closed

DL::Handle#sym segfaults with nil

Added by nobu (Nobuyoshi Nakada) about 15 years ago. Updated almost 13 years ago.

Status:
Closed
Assignee:
-
Target version:
ruby -v:
ruby 1.9.2dev (2009-03-11 trunk 22881) [i386-darwin9.0]
Backport:
[ruby-dev:38150]

Description

=begin
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 <main>' -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
=end


Files

dlhandle.diff (2.08 KB) dlhandle.diff DL::Handle.sym & DL::Handle.[] nobu (Nobuyoshi Nakada), 03/11/2009 06:48 PM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0