From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thien-Thi Nguyen Newsgroups: gmane.lisp.guile.bugs Subject: Re: guile 1.9.0 scm_read_hash_extend gc trouble Date: Mon, 22 Jun 2009 10:50:07 +0200 Message-ID: <878wjkejpc.fsf@ambire.localdomain> References: <20090621120823.M97037@ccrma.Stanford.EDU> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1245767511 6108 80.91.229.12 (23 Jun 2009 14:31:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 23 Jun 2009 14:31:51 +0000 (UTC) To: bug-guile@gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Tue Jun 23 16:31:44 2009 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MJ72F-00051M-7W for guile-bugs@m.gmane.org; Tue, 23 Jun 2009 16:31:43 +0200 Original-Received: from localhost ([127.0.0.1]:44686 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MJ72E-0004B8-Ga for guile-bugs@m.gmane.org; Tue, 23 Jun 2009 10:31:42 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MIfJi-0005QQ-4H for bug-guile@gnu.org; Mon, 22 Jun 2009 04:55:54 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MIfJe-0005PA-4j for bug-guile@gnu.org; Mon, 22 Jun 2009 04:55:53 -0400 Original-Received: from [199.232.76.173] (port=45508 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MIfJd-0005P2-QC for bug-guile@gnu.org; Mon, 22 Jun 2009 04:55:49 -0400 Original-Received: from smtp-out112.alice.it ([85.37.17.112]:4033) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MIfJd-00088k-9b for bug-guile@gnu.org; Mon, 22 Jun 2009 04:55:49 -0400 Original-Received: from FBCMMO02.fbc.local ([192.168.68.196]) by smtp-out112.alice.it with Microsoft SMTPSVC(6.0.3790.3959); Mon, 22 Jun 2009 10:55:45 +0200 Original-Received: from FBCMCL01B09.fbc.local ([192.168.171.26]) by FBCMMO02.fbc.local with Microsoft SMTPSVC(6.0.3790.1830); Mon, 22 Jun 2009 10:55:45 +0200 Original-Received: from ambire.localdomain ([79.16.71.2]) by FBCMCL01B09.fbc.local with Microsoft SMTPSVC(6.0.3790.3959); Mon, 22 Jun 2009 10:55:44 +0200 Original-Received: from ttn by ambire.localdomain with local (Exim 4.63) (envelope-from ) id 1MIfE7-0004Mt-7a for bug-guile@gnu.org; Mon, 22 Jun 2009 10:50:07 +0200 In-Reply-To: <20090621120823.M97037@ccrma.Stanford.EDU> (Bill Schottstaedt's message of "Sun, 21 Jun 2009 05:10:09 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-OriginalArrivalTime: 22 Jun 2009 08:55:44.0868 (UTC) FILETIME=[3A89DA40:01C9F317] X-detected-operating-system: by monty-python.gnu.org: Windows 2000 SP4, XP SP1+ X-Mailman-Approved-At: Tue, 23 Jun 2009 10:21:12 -0400 X-BeenThere: bug-guile@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:4239 Archived-At: () "Bill Schottstaedt" () Sun, 21 Jun 2009 05:10:09 -0700 code to implement #|..|# block comment processing triggers either a glibc memory complaint or a segfault. FWIW, below is the implementation from Guile 1.4.1.118 (not yet released). It handles nesting (per R6RS, i believe) and a weird lookahead case. thi _____________________________________________________________ /* Skip #|...|# block comments. */ static void skip_hashpipe_block_comment (SCM port) { #define FUNC_NAME s_scm_read int c; bool pipep = false; int oline = SCM_LINUM (port); int ocol = SCM_COL (port); for (;;) { if (EOF == (c = GETC ())) toosoon: { char buf[149]; snprintf (buf, 149, "%s\n%s:%d:%d: (starting here)", "unterminated `#| ... |#' comment", c_port_filename (port), 1 + oline, ocol - 1); BADNESS (0, buf); } if (pipep && '#' == c) return; /* Handle nested comments. */ retry: if ('#' == c) { if (EOF == (c = GETC ())) goto toosoon; if ('|' == c) { skip_hashpipe_block_comment (port); pipep = false; } else /* Don't get fooled by ##|...|# (ugh). */ goto retry; } pipep = ('|' == c); } #undef FUNC_NAME }