[Bug:1.8] segmentetion fault by Marshal.dump

e$B@>;3OB9-$G$9!#e(B

Marshal.dumpe$B$KBhe(B2e$B0z?t$Ne(BIOe$B$r;XDj$9$k$HMn$A$^$9!#e(B

% ruby18 -ve ‘Marshal.dump(nil, open("/dev/null", “wb”))’
ruby 1.8.7 (2008-09-27 revision 19596) [i686-linux]
-e:1: [BUG] Segmentation fault
ruby 1.8.7 (2008-09-27 revision 19596) [i686-linux]
%

check_dump_arge$B$Ne(Barg->wrappere$B$,e(BNULLe$B$N;~$KMn$A$k$h$&$G!"e(B
e$B0J2<$N$h$&$K=i4|2=$9$k$H3N<B$K:F8=$G$-$^$9!#e(B

Index: marshal.c

— marshal.c(e$B%j%S%8%g%se(B 19651)
+++ marshal.c(e$B:n6H%3%T!<e(B)
@@ -761,7 +761,7 @@
{
VALUE obj, port, a1, a2;
int limit = -1;

  • struct dump_arg arg;
  • struct dump_arg arg = {0};
    struct dump_call_arg c_arg;

    port = Qnil;

e$B%A%1%C%He(B #613 e$B$,99?7$5$l$^$7$?!#e(B (by Nobuyoshi N.)

e$B%9%F!<%?%9e(B Opene$B$+$ie(BClosede$B$KJQ99e(B
e$B?JD=e(B % 0e$B$+$ie(B100e$B$KJQ99e(B

Applied in changeset r19652.

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