[Bug #1967] Segmentation fault at test_qsort1 and test_qsort2 in test/dl/test_func.rb running on spa

Bug #1967: Segmentation fault at test_qsort1 and test_qsort2 in
test/dl/test_func.rb running on sparc-solaris-2.10
http://redmine.ruby-lang.org/issues/show/1967

e$B5/I<<Te(B: Naohisa G.
e$B%9%F!<%?%9e(B: Open, e$BM%@hEYe(B: Normal
ruby -v: ruby 1.9.2dev (2009-08-19) [sparc-solaris2.10]

sparc-solaris-2.10 e$B$Ge(B 64e$B%S%C%H%3%s%Q%$%k$7$?>l9g!"e(B
make check e$B$,e(B test/dl/test_func.rb e$B$Ne(B test_qsort1 e$B$K$Fe(B
Segmentation fault e$B$K$J$j$^$9!#e(B

e$B860x$O!"0z?t$N7?$G$7$?!#e(B
void qsort(void *base, size_t nmemb, size_t size,
int(*compar)(const void *, const void ));
e$B$Ne(B size_t e$B7?$N0z?te(B nmenb e$B$
$h$Se(B size e$B$KBP$7$Fe(B
TYPE_INT e$B$,;XDj$5$l$F$$$^$9$,!"e(B
size_t e$B$Oe(B 64e$B%S%C%H4D6-$G$Oe(B unsigned long
e$B$K$J$k$?$a!“FC$Ke(Bsparc v9 e$B$N$h$&$Je(B
e$B%S%C%0%(%s%G%#%”%s$N4D6-$G$O0[>o$J?tCM$,e(B qsort
e$B$N0z?t$KEO$k$N$,860x$G$7$?!#e(B

TYPE_INT e$B$re(B TYPE_LONG e$B$KJQ99$7$?0J2<$N%Q%C%A$GD>$j$^$7$?!#e(B
(TYPE_SIZE_T e$B$OB8:_$7$J$$!)e(B)

Index: test/dl/test_func.rb

— test/dl/test_func.rb (revision 24582)
+++ test/dl/test_func.rb (working copy)
@@ -43,7 +43,7 @@
cb = Function.new(CFunc.new(0, TYPE_INT, ‘qsort’),
[TYPE_VOIDP, TYPE_VOIDP]){|x,y| CPtr.new(x)[0]
<=> CPtr.new(y)[0]}
qsort = Function.new(CFunc.new(@libc[‘qsort’], TYPE_VOID,
‘qsort’),

  •                       [TYPE_VOIDP, TYPE_INT, TYPE_INT, 
    

TYPE_VOIDP])

  •                       [TYPE_VOIDP, TYPE_LONG, TYPE_LONG, 
    

TYPE_VOIDP])
buff = “9341”
qsort.call(buff, buff.size, 1, cb)
assert_equal(“1349”, buff)
@@ -53,7 +53,7 @@
cb = TempFunction.new(CFunc.new(0, TYPE_INT, ‘qsort’),
[TYPE_VOIDP, TYPE_VOIDP])
qsort = Function.new(CFunc.new(@libc[‘qsort’], TYPE_VOID,
‘qsort’),

  •                       [TYPE_VOIDP, TYPE_INT, TYPE_INT, 
    

TYPE_VOIDP])

  •                       [TYPE_VOIDP, TYPE_LONG, TYPE_LONG, 
    

TYPE_VOIDP])
buff = “9341”
qsort.call(buff, buff.size, 1, cb){|x,y| CPtr.new(x)[0] <=>
CPtr.new(y)[0]}
assert_equal(“1349”, buff)

e$B%A%1%C%He(B #1967 e$B$,99?7$5$l$^$7$?!#e(B (by Yusuke E.)

e$BC4Ev<Te(B Aaron P.e$B$K%;%C%He(B

e$B%"!<%m%s08$G$9!#e(B
e$B1sF#$G$9!#e(B

dl e$B$K4X$9$k$3$N%A%1%C%H$r$I$&;W$$$^$9$+!)e(B
ffi e$B$KF1$8$h$&$JLdBj$O$J$$$G$9$+!)e(B

dl e$B$O$9$G$Ke(B x86_64 e$B$K$*$1$ke(B API
e$B@_7W>e$NLdBj$,;XE&$5$l$F$$$ke(B [1] e$B$N$G!“e(B
ffi e$B$KF1$8LdBj$,$J$$$N$J$i!”$3$NLdBj$Oe(B WONTFIX
e$B$G$b9=$o$J$$$H;W$$$^$9!#e(B

e$B$=$N>l9g!"LdBj$N%F%9%H$r>C$9$Y$-$@$m$&$+e(B

[1] 革命の日々! Rubyで学ぶx86_64 ABI


Yusuke E. [email protected]

http://redmine.ruby-lang.org/issues/show/1967

e$B%A%1%C%He(B #1967 e$B$,99?7$5$l$^$7$?!#e(B (by Yusuke E.)

Hi, Aaron

Could you take a look at this ticket?


Yusuke E. [email protected]

http://redmine.ruby-lang.org/issues/show/1967

2010/4/27 Yusuke E. [email protected]:

e$B%A%1%C%He(B #1967 e$B$,99?7$5$l$^$7$?!#e(B (by Yusuke E.)

e$BC4Ev<Te(B Aaron P.e$B$K%;%C%He(B

e$B%"!<%m%s08$G$9!#e(B
e$B1sF#$G$9!#e(B

dl e$B$K4X$9$k$3$N%A%1%C%H$r$I$&;W$$$^$9$+!)e(B
ffi e$B$KF1$8$h$&$JLdBj$O$J$$$G$9$+!)e(B

ffie$B$Oe(B x86_64 e$B$re(Bsupporte$B$7$F$$$k$N$G!"e(Bffi
e$B$KF1$8$h$&$JLdBj$O$J$$$H;W$$$^$9!#e(B

dl e$B$O$9$G$Ke(B x86_64 e$B$K$*$1$ke(B API e$B@_7W>e$NLdBj$,;XE&$5$l$F$$$ke(B [1] e$B$N$G!“e(B
ffi e$B$KF1$8LdBj$,$J$$$N$J$i!”$3$NLdBj$Oe(B WONTFIX e$B$G$b9=$o$J$$$H;W$$$^$9!#e(B

e$B$3$N7o$Ne(BABI
e$B$NK]Lu$Oe(Bffie$B<+?H$N%?%9%/$J$N$G!"$3$N%A%1%C%H$Oe(BWONTFIXe$B$H$7$F$*$$$F!"LdBj$J$$$H;W$$$^$9!#e(B

e$B%A%1%C%He(B #1967 e$B$,99?7$5$l$^$7$?!#e(B (by Yusuke E.)

e$B%9%F!<%?%9e(B Assignede$B$+$ie(BRejectede$B$KJQ99e(B

e$B1sF#$G$9!#e(B

e$B$=$l$G$O!"e(BWONTFIX e$B$H$$$&$3$H$GJD$8$^$9!#e(B
64 e$B%S%C%He(B Solaris e$B$G%F%9%H$r$9$k>l9g$Oe(B fiddle
e$B$r;HMQ$7$F$/$@$5$$!#e(B


Yusuke E. [email protected]

http://redmine.ruby-lang.org/issues/show/1967