unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Andy Wingo <wingo@pobox.com>
To: Mark H Weaver <mhw@netris.org>
Cc: guile-user <guile-user@gnu.org>
Subject: Re: smob mark functions in 2.0
Date: Sat, 27 Sep 2014 17:29:02 +0200	[thread overview]
Message-ID: <87iok92ibl.fsf@pobox.com> (raw)
In-Reply-To: <87tx3vc7d9.fsf@yeeloong.lan> (Mark H. Weaver's message of "Fri,  26 Sep 2014 00:50:58 -0400")

On Fri 26 Sep 2014 06:50, Mark H Weaver <mhw@netris.org> writes:

> Mark H Weaver <mhw@netris.org> writes:
>
>> Andy Wingo <wingo@pobox.com> writes:
>>> Specifically, there is a warning in gc/gc_mark.h:
>>>
>>>     /* WARNING: Such a mark procedure may be invoked on an unused object    */
>>>     /* residing on a free list.  Such objects are cleared, except for a     */
>>>     /* free list link field in the first word.  Thus mark procedures may    */
>>>     /* not count on the presence of a type descriptor, and must handle this */
>>>     /* case correctly somehow.                                              */
>>>
>>> So, your mark function might see freed objects.
>>
>> How can this happen?

This can happen if the object is on a free list.  Free lists are just
normal heap-managed data structures -- traced by the GC, counting as
live.  See e.g. gc-inline.h in master; a variation of this exact code is
used internally in libgc by the allocation API.

Andy
-- 
http://wingolog.org/



      reply	other threads:[~2014-09-27 15:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-23 21:20 smob mark functions in 2.0 Andy Wingo
2011-11-23 23:12 ` Ludovic Courtès
2011-11-24 10:56   ` Andy Wingo
2011-11-24 23:24     ` Ludovic Courtès
2011-11-30 15:29 ` Mark H Weaver
2014-09-26  4:50   ` Mark H Weaver
2014-09-27 15:29     ` Andy Wingo [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=87iok92ibl.fsf@pobox.com \
    --to=wingo@pobox.com \
    --cc=guile-user@gnu.org \
    --cc=mhw@netris.org \
    /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).