Project

General

Profile

Actions

Bug #613

closed

segmentetion fault by Marshal.dump

Added by znz (Kazuhiro NISHIYAMA) over 15 years ago. Updated almost 13 years ago.

Status:
Closed
Target version:
-
ruby -v:
[ruby-dev:36648]

Description

=begin
西山和広です。

Marshal.dumpに第2引数のIOを指定すると落ちます。

% 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_argのarg->wrapperがNULLの時に落ちるようで、
以下のように初期化すると確実に再現できます。

Index: marshal.c

--- marshal.c(リビジョン 19651)
+++ marshal.c(作業コピー)
@@ -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;

--
|ZnZ(ゼット エヌ ゼット)
|西山和広(Kazuhiro NISHIYAMA)
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0