From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.lisp.guile.user Subject: Re: smob mark functions in 2.0 Date: Thu, 24 Nov 2011 00:12:05 +0100 Message-ID: <874nxumo1m.fsf@gnu.org> References: <87aa7mmt76.fsf@pobox.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1322089961 21089 80.91.229.12 (23 Nov 2011 23:12:41 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 23 Nov 2011 23:12:41 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Thu Nov 24 00:12:36 2011 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RTLzS-00036T-Cu for guile-user@m.gmane.org; Thu, 24 Nov 2011 00:12:30 +0100 Original-Received: from localhost ([::1]:58527 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTLzR-00005v-SK for guile-user@m.gmane.org; Wed, 23 Nov 2011 18:12:29 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:39932) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTLzK-0008Ua-Ow for guile-user@gnu.org; Wed, 23 Nov 2011 18:12:25 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RTLzJ-0002Fy-If for guile-user@gnu.org; Wed, 23 Nov 2011 18:12:22 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:45852) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTLzJ-0002Fs-A0 for guile-user@gnu.org; Wed, 23 Nov 2011 18:12:21 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1RTLzF-0002ue-Tg for guile-user@gnu.org; Thu, 24 Nov 2011 00:12:17 +0100 Original-Received: from reverse-83.fdn.fr ([80.67.176.83]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 24 Nov 2011 00:12:17 +0100 Original-Received: from ludo by reverse-83.fdn.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 24 Nov 2011 00:12:17 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 25 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: reverse-83.fdn.fr X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 4 Frimaire an 220 de la =?iso-8859-1?Q?R=E9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.90 (gnu/linux) Cancel-Lock: sha1:Y1Qy26JBRddQUqzAyzGXjJkCB+I= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:8994 Archived-At: Hello! Andy Wingo skribis: > 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. */ Arrgh! > So, your mark function might see freed objects. This is terrible, but > it is the way that it is. The key is that, if you touch a Scheme object > in your mark function, to first do a check on that object, to see that > it is valid. You can check the TC bits of the first word, or otherwise > check that other words are non-NULL. What about making that check in libguile before invoking the user’s mark function? Thanks, Ludo’.