From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: Re: full moon, vm status update Date: Thu, 16 Oct 2008 23:21:33 +0200 Message-ID: References: <87y70owdeq.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1224192793 28293 80.91.229.12 (16 Oct 2008 21:33:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 16 Oct 2008 21:33:13 +0000 (UTC) Cc: guile-devel@gnu.org To: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Oct 16 23:34:12 2008 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KqaSy-0006N3-3b for guile-devel@m.gmane.org; Thu, 16 Oct 2008 23:33:09 +0200 Original-Received: from localhost ([127.0.0.1]:46353 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KqaRr-0007rw-M7 for guile-devel@m.gmane.org; Thu, 16 Oct 2008 17:31:59 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KqaRp-0007rg-0r for guile-devel@gnu.org; Thu, 16 Oct 2008 17:31:57 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KqaRm-0007rR-FP for guile-devel@gnu.org; Thu, 16 Oct 2008 17:31:55 -0400 Original-Received: from [199.232.76.173] (port=42889 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KqaRm-0007rO-7G for guile-devel@gnu.org; Thu, 16 Oct 2008 17:31:54 -0400 Original-Received: from a-sasl-fastnet.sasl.smtp.pobox.com ([207.106.133.19]:42929 helo=sasl.smtp.pobox.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KqaRX-00088L-Dd; Thu, 16 Oct 2008 17:31:40 -0400 Original-Received: from localhost.localdomain (localhost [127.0.0.1]) by a-sasl-fastnet.sasl.smtp.pobox.com (Postfix) with ESMTP id 906A66FDBD; Thu, 16 Oct 2008 17:31:30 -0400 (EDT) Original-Received: from unquote (117.Red-79-156-146.staticIP.rima-tde.net [79.156.146.117]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-sasl-fastnet.sasl.smtp.pobox.com (Postfix) with ESMTPSA id 964326FDBC; Thu, 16 Oct 2008 17:31:27 -0400 (EDT) In-Reply-To: <87y70owdeq.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Thu, 16 Oct 2008 21:25:17 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-Pobox-Relay-ID: CC174592-9BC9-11DD-9201-1E1F86D30F62-02397024!a-sasl-fastnet.pobox.com X-detected-operating-system: by monty-python.gnu.org: Solaris 10 (beta) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:7786 Archived-At: Howdy, On Thu 16 Oct 2008 21:25, ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Andy Wingo writes: > >> * The VM stack is now marked precisely. > > Did you mean stack frame objects that link `program' object invocations? > I guess this stack is referenced by the C stack, so why does something > special need to be done? I mean that instead of using scm_mark_locations() to mark the active region of the allocated VM stack (vp->stack_base to vp->sp), we use vm.c:vm_mark_stack() to mark that region precisely. >> * There is a now a debugging mode, currently turned on, in which we >> try ensure that the top of the stack is non-NULL and that all >> elements past the top are set to NULL. There are a number of checks >> in various places that this is the case. The idea is to avoid lost >> references when GC runs, and the heap structure's idea of the VM >> registers is out of sync with what the VM regs actually are; or >> there is some sloppy programming somewhere. When turned off, this >> code incurs no overhead. >> >> This mode helped to catch a number of stack GC bugs. > > Are you referring to leaks due to a stack that contains references to > Scheme objects that have not been overwritten for a while? Or are there > other bugs? For example, the fix to libguile/vm-engine.h:POP_LIST in 11ea1aba9eb9. (POP_LIST): Hoo, fix a good bug: if CONS triggered a GC, the elements of the list that had not yet been consed would not be marked, because the sp was already below them. @@ -275,10 +283,12 @@ do \ { \ int i; \ - SCM l =3D SCM_EOL; \ - sp -=3D n; \ - for (i =3D n; i; i--) \ - CONS (l, sp[i], l); \ + SCM l =3D SCM_EOL, x; \ + for (i =3D n; i; i--) \ + { \ + POP (x); \ + CONS (l, x, l); \ + } \ PUSH (l); \ } while (0) How's that for a hard-to-find bug!!!=20 >> * Actually the bit about all of the test suites passing was a lie in >> another respect: the elisp test fails, with a C stack overflow, >> indicating too much recursion into the interpreter. > > I've seen `elisp.test' trigger a stack overflow with the interpreter > more often than any other test. Don't know why. I hacked around this -- see what I've pushed to vm for more info. >> My goal is: correct execution of all existing code that: >> * does not do runtime side-effects in macros >> * does not call (the-environment) >> * does not unquote in values into macros > > How about code that does "(read-set! keywords 'prefix)" and the likes? > :-) Oooh, just because you do dastardly things with the reader ;) You are right. Code that causes side effects to the reader will not cause those side effects until after the rest of the file is read, even if you (eval-case ((load-toplevel compile-toplevel) ...)) it. For what you want, I suggest #!lang things and reader macros (neither of which we have yet). Cheers, Andy --=20 http://wingolog.org/