[Bug #669] nil を引数にして Iconv.new を呼ぶとSEGV


#1

Bug #669: nil e$B$r0z?t$K$7$Fe(B Iconv.new e$B$r8F$V$He(BSEGV
http://redmine.ruby-lang.org/issues/show/669

e$B5/I<<Te(B: Hiroshi M.
e$B%9%F!<%?%9e(B: Open, e$BM%@hEYe(B: Normal
e$B%+%F%4%je(B: ext, Target version: 1.9.x

e$B<!$NNc$N$h$&$Ke(B Iconv.new e$B$de(B Iconv.open
e$B$J$I$NBh0l!"Kt$OBhFs0ze(B
e$B?t$Ke(B nil e$B$r;XDj$7$F8F$V$H!"e(Brubye$B$,Mn$A$^$9!#e(Bnil
e$B$NB>$K$O%7%s%\e(B
e$B%k$de(B true e$B$J$I$GMn$A$^$7$?!#%Q%C%A%U%!%$%k$rE:IU$7$^$9!#e(B

e$BNce(B:

% ./ruby1.9 -riconv -e Iconv.new(nil, UTF-8)
-e:1: [BUG] Segmentation fault
ruby 1.9.0 (2008-10-21 revision 19843) [i686-linux]

control frame ----------
c:0005 p:---- s:0013 b:0013 l:000012 d:000012 CFUNC :initialize
c:0004 p:---- s:0011 b:0011 l:000010 d:000010 CFUNC :new
c:0003 p:0018 s:0006 b:0006 l:000005 d:000005 TOP -e:1
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH :inherited
c:0001 p:0000 s:0002 b:0002 l:000001 d:000001 TOP :17

DBG> : -e:1:in initialize'" DBG> : "-e:1:innew
DBG> : -e:1:in `
backtrace of native function call (Use addr2line)
0x811c205
0x81486ce
0x814872b
0x80cef73
0xb7f36440
0xb7f268c7
0xb7f270ee
0x810ca3e
0x8119223
0x8119696
0x8059ca3
0x808151a
0x810ca3e
0x811a9c2
0x8112e89
0x81174db
0x8117709
0x805a27f
0x805bbbe
0x8059131
0xb7d90ea8
0x8059041

zsh: abort ./ruby1.9 -riconv -e Iconv.new(nil, UTF-8)