Project

General

Profile

Bug #613

segmentetion fault by Marshal.dump

Added by znz (Kazuhiro NISHIYAMA) almost 11 years ago. Updated about 8 years ago.

Status:
Closed
Priority:
Normal
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

History

#1

Updated by znz (Kazuhiro NISHIYAMA) almost 11 years ago

  • Assignee set to nobu (Nobuyoshi Nakada)

=begin

=end

#2

Updated by nobu (Nobuyoshi Nakada) almost 11 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
Applied in changeset r19652.
=end

Also available in: Atom PDF