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: Unsafe psyntax label generation Date: Thu, 26 Jan 2012 12:26:51 +0100 Message-ID: <87ehumaemc.fsf@pobox.com> References: <87zkddqjwz.fsf@netris.org> <87ehuolrk0.fsf@pobox.com> <87mx9cr21z.fsf@netris.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1327580121 6367 80.91.229.12 (26 Jan 2012 12:15:21 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 26 Jan 2012 12:15:21 +0000 (UTC) Cc: guile-devel@gnu.org To: Mark H Weaver Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Jan 26 13:15:17 2012 Return-path: Envelope-to: guile-devel@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 1RqOEX-0002b3-FT for guile-devel@m.gmane.org; Thu, 26 Jan 2012 13:15:17 +0100 Original-Received: from localhost ([::1]:36792 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RqOEW-0007xL-Sc for guile-devel@m.gmane.org; Thu, 26 Jan 2012 07:15:16 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:57176) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RqOEL-0007nr-EL for guile-devel@gnu.org; Thu, 26 Jan 2012 07:15:15 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RqOEB-0006GL-CZ for guile-devel@gnu.org; Thu, 26 Jan 2012 07:15:05 -0500 Original-Received: from a-pb-sasl-sd.pobox.com ([74.115.168.62]:46927 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RqOEB-0006GA-AU for guile-devel@gnu.org; Thu, 26 Jan 2012 07:14:55 -0500 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 22B9B7C36; Thu, 26 Jan 2012 07:14:55 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=6ZvnRi00of0AM7jNNVU29rX50Ko=; b=xwHMsw pxjZvTLOHcOxMtzLiyti22o+vc7bcglstOkCRFT18qEWwFq4bRAOtv2tlAkd/UGs qnIwZh91TGcb+eRioI6CAUswn0kbMrBOCnR92agQNTq7tTaXzcecl98t9eDt2xcH iyrmVweebjGjRK9Wit3RYDlAQKkRvkpGFVcHo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=qxHVu23dfuRBjgsMTQgtf0JTzq9QBMew 6eI5e5hwVSwMy035QP1WR+WBM++KZ40tvQnLkxvmKRm97POMO5gqNk4w45KaHBRF xUP18b84vRpS3ZLyIVZvFgkrGBxHfnEY8koNS1ywJXgRFb9U92rXTJFhl4PfcJSt z77qo47+PP0= Original-Received: from a-pb-sasl-sd.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 1B1087C35; Thu, 26 Jan 2012 07:14:55 -0500 (EST) Original-Received: from badger (unknown [90.164.198.39]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id 7ACF17C34; Thu, 26 Jan 2012 07:14:54 -0500 (EST) In-Reply-To: <87mx9cr21z.fsf@netris.org> (Mark H. Weaver's message of "Tue, 24 Jan 2012 20:41:44 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) X-Pobox-Relay-ID: 5B077DC4-4817-11E1-B904-65B1DE995924-02397024!a-pb-sasl-sd.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 74.115.168.62 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:13690 Archived-At: Heya Mark, On Wed 25 Jan 2012 02:41, Mark H Weaver writes: >> On Tue 24 Jan 2012 15:01, Mark H Weaver writes: >> >>> `local-eval' combines syntax objects from two different sessions into a >>> single syntax object (in the wrapper procedure), and thus there may be >>> label name collisions. Now, if this combined syntax object is >>> serialized as a compiled procedure, these labels with the same name will >>> be optimized together into the same string object! >> > How would you like to fix this? Would you like me to make a new > procedure that creates a universally-unique string? Most of `gensym's > current code would be moved to that new procedure, and then `gensym' > would use it. I effectively did that: both marks and labels are now globally unique. At some point though, I realized that not all gensyms need to be globally unique. For example, the gensyms used in Tree-IL only need to be unique within a session. So in the end I reverted your gensym patch, and reworked some pieces of it to provide a "session identifier" to the expander, which is included in generated symbols and strings that need to be unique across sessions. The procedure that provides this identifier then gets shunted off into the (system syntax) toolshed after boot. Comments very much welcome, and thanks again for working on this problem. Andy -- http://wingolog.org/