unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Mike Gran <spk121@yahoo.com>
Cc: guile-devel@gnu.org
Subject: Re: [PATCH] test for smob mark segv
Date: Fri, 01 Mar 2013 10:37:45 +0100	[thread overview]
Message-ID: <87y5e7795i.fsf@gnu.org> (raw)
In-Reply-To: <1361896604.81463.YahooMailNeo@web120406.mail.ne1.yahoo.com> (Mike Gran's message of "Tue, 26 Feb 2013 08:36:44 -0800 (PST)")

Hi Mike,

Mike Gran <spk121@yahoo.com> skribis:

> It is a standalone test that, in effect, checks to see if
> BDW-GC is running marking in its own non-Guile thread.  If
> BDW does have parallel marking enabled, this test will SEGV.
> If it doesn't have parallel marking enabled, this test will pass.

Good.

FWIW, I’ve been meaning to fix the problem for good.  I hope to post a
patch within the next few days.

> From f3adf180edbf6ebe642cf4c1ad8f029ce0876d0d Mon Sep 17 00:00:00 2001
> From: Mike Gran <spk121@yahoo.com>
> Date: Tue, 26 Feb 2013 08:27:22 -0800
> Subject: [PATCH] Add standalone test for smob marking
>
> * test-suite/standalone/Makefile.am: add test-smob-mark

Specify the makefile variable name in parentheses.

> * test-suite/standalone/test-smob-mark.c: new test
> * test-suite/standalone/.gitignore: ignore test-smob-mark

No need for .gitignore here.

> +typedef struct x_tag
> +{
> +  SCM scm_value;
> +  int c_value;
> +} x_t;

Separate typedef and struct.

> +static scm_t_bits x_tag;
> +SCM make_x (void);
> +SCM mark_x (SCM x);
> +int print_x (SCM x, SCM port, scm_print_state * pstate);
> +size_t free_x (SCM x);
> +void init_smob_type (void);
> +void test_scm_smob_mark (void);

Make them all static.

> +SCM
> +mark_x (SCM x)
> +{
> +  x_t *c_x;
> +  c_x = (x_t *) SCM_SMOB_DATA (x);
> +  scm_gc_mark (c_x->scm_value);
> +  return SCM_BOOL_F;
> +}

I think it’d be good to increment a global counter to make sure the mark
procedure is called at all.

Thanks!

Ludo’.



      parent reply	other threads:[~2013-03-01  9:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-26 16:36 [PATCH] test for smob mark segv Mike Gran
2013-03-01  4:47 ` Mike Gran
2013-03-01  9:37 ` Ludovic Courtès [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y5e7795i.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guile-devel@gnu.org \
    --cc=spk121@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).