From: ludo@gnu.org (Ludovic Courtès)
To: 20087@debbugs.gnu.org
Subject: bug#20087: 'gensym' is not guaranteed to return a fresh symbol
Date: Wed, 11 Mar 2015 18:15:02 +0100 [thread overview]
Message-ID: <87a8zjxxpl.fsf@gnu.org> (raw)
‘gensym’ returns interned symbols, but the algorithm to determine the
new symbol is simplistic and predictable.
Thus, one can arrange to produce a symbol before ‘gensym’ does, leading
‘gensym’ to return a symbol that’s not fresh (in terms of ‘eq?’), as is
the case with the second call to ‘gensym’ here:
--8<---------------cut here---------------start------------->8---
scheme@(guile-user)> (gensym "x")
$1 = x379
scheme@(guile-user)> 'x405
$2 = x405
scheme@(guile-user)> (gensym "x")
$3 = x405
--8<---------------cut here---------------end--------------->8---
Should we worry about it? I think it may have hard to anticipate
security implications.
Ludo’.
next reply other threads:[~2015-03-11 17:15 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-11 17:15 Ludovic Courtès [this message]
2016-03-18 17:03 ` bug#20087: gensym rain1
2016-03-22 5:24 ` Mark H Weaver
2016-03-22 7:58 ` Ludovic Courtès
2016-03-23 17:55 ` Mark H Weaver
2016-03-24 8:45 ` Ludovic Courtès
2016-06-23 13:48 ` Andy Wingo
2016-06-23 14:13 ` Ludovic Courtès
2016-06-23 16:05 ` Andy Wingo
2016-03-22 11:21 ` rain1
2016-03-22 18:06 ` Mark H Weaver
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=87a8zjxxpl.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=20087@debbugs.gnu.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).