Project

General

Profile

Actions

Bug #2181

closed

Segmentation fault for test/drb/* -- possible bug in Marshal/GC

Added by nlugovoi (Nikolai Lugovoi) about 15 years ago. Updated over 13 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 1.9.2dev (2009-10-06) [i686-linux]
Backport:
[ruby-core:25969]

Description

=begin
After changeset r25230 in marshal.c I see some segfaults (at various places)when running make test-all or only test suite test/drb/*, see attached file test-crash.txt

Removing gc marks for elements of struct load_arg seems to fix the problem:

--- a/marshal.c
+++ b/marshal.c
@@ -971,16 +971,6 @@ check_load_arg(struct load_arg *arg, ID sym)
static void clear_load_arg(struct load_arg *arg);

static void
-mark_load_arg(void *ptr)
-{

  • struct load_arg *p = ptr;
  • if (!ptr)
  •    return;
    
  • rb_mark_tbl(p->data);
  • rb_mark_hash(p->compat_tbl);
    -}

-static void
free_load_arg(void *ptr)
{
clear_load_arg(ptr);
@@ -995,7 +985,7 @@ memsize_load_arg(const void *ptr)

static const rb_data_type_t load_arg_data = {
"load_arg",

  • mark_load_arg, free_load_arg, memsize_load_arg
  • NULL, free_load_arg, memsize_load_arg
    };

static VALUE r_entry(VALUE v, struct load_arg *arg);
=end


Files

test-crash.txt (7.9 KB) test-crash.txt nlugovoi (Nikolai Lugovoi), 10/06/2009 10:18 PM
Actions #1

Updated by nobu (Nobuyoshi Nakada) about 15 years ago

=begin
Hi,

At Tue, 6 Oct 2009 22:18:47 +0900,
Nikolai Lugovoi wrote in [ruby-core:25969]:

After changeset r25230 in marshal.c I see some segfaults (at
various places)when running make test-all or only test suite
test/drb/*, see attached file test-crash.txt

Does this patch fix it?


Index: marshal.c

--- marshal.c (revision 25242)
+++ marshal.c (working copy)
@@ -163,5 +163,5 @@ mark_dump_arg(void *ptr)
{
struct dump_arg *p = ptr;

  • if (!ptr)
  • if (!p->symbols)
    return;
    rb_mark_set(p->data);
    @@ -975,5 +975,5 @@ mark_load_arg(void *ptr)
    {
    struct load_arg *p = ptr;
  • if (!ptr)
  • if (!p->symbols)
    return;
    rb_mark_tbl(p->data);

--
Nobu Nakada

=end

Actions #2

Updated by nlugovoi (Nikolai Lugovoi) about 15 years ago

=begin
On Wed, Oct 7, 2009 at 6:01 AM, Nobuyoshi Nakada wrote:

Does this patch fix it?

Index: marshal.c

--- marshal.c   (revision 25242)
+++ marshal.c   (working copy)
@@ -163,5 +163,5 @@ mark_dump_arg(void *ptr)
 {
    struct dump_arg *p = ptr;

  •    if (!ptr)
  •    if (!p->symbols)
            return;
        rb_mark_set(p->data);
    @@ -975,5 +975,5 @@ mark_load_arg(void *ptr)
     {
        struct load_arg *p = ptr;
  •    if (!ptr)
  •    if (!p->symbols)
            return;
        rb_mark_tbl(p->data);

Yes, with this patch I cannot reproduce that crash any more.

=end

Actions #3

Updated by nobu (Nobuyoshi Nakada) about 15 years ago

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

=begin
Applied in changeset r25256.
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0