[Bug-openmcl] asdf gensym problem

Gary Byers gb at clozure.com
Sun Jul 31 22:21:31 MDT 2005



On Sun, 31 Jul 2005, bryan o'connor wrote:

> if asdf is used before gensym has been called for the
> first time (*gensym-counter* is 0 or 1), it will sometimes
> fail trying to make-package an existing package (asdf1).
> the package name is generated with (gensym "asdf").
>

I don't see how that could possibly work reliably.

GENSYM will create dynamically unique symbols (by virtue of
the fact that the symbols it creates are uninterned.)  It doesn't
guarantee that symbols saved to FASL files in one session will
have pnames that are distinct from symbols created in another
session; I can't imagine how it could do that unless it could
somehow guarantee that the *GENSYM-COUNTER*s of all images used
to create FASL files that contained gensyms were somehow kept
in synch (via some sort of distributed network GENSYM-COUNTER
server, or via magic.)

Since package names are compared via (something like) STRING=,
using GENSYM to create unique package names can't work reliably.
(It might work often enough that this bug would go unnoticed
for a long time, but it seems clear to me that it's a bug.)

I don't think that anything changed in the implementation of GENSYM
(or in SAVE-APPLICATION's handling of it) recently, though I may be
mistaken about that.  If there -were- some such change and we backed
out of it, I'm fairly sure that we could construct a scenario where
ASDF's use of GENSYM to name packages would also fail.


> since turning on trace avoids the problem because it calls
> gensym, the transcript below is broken into two sessions.
>
>> openmcl -n
> Welcome to OpenMCL Version (Beta: DarwinPPC32) 0.14.4-pre-050729!
> ? (require :asdf)
> :ASDF
> ("ASDF")
> ? (pushnew #4p"home:lib;asdf-systems;" asdf:*central-registry*)
> (#P"home:lib;asdf-systems;" *DEFAULT-PATHNAME-DEFAULTS*)
> ? (find-package :asdf)
> #<Package "ASDF">
> ? (find-package :asdf1)
> #<Package "ASDF1">
> ? *gensym-counter*
> 0
> ? (require :lisppaste)
>> Error in process listener(1): Package name "ASDF1" is already in use.
>> While executing: CCL::NEW-PACKAGE-NAME
>
>
>> openmcl -n
> Welcome to OpenMCL Version (Beta: DarwinPPC32) 0.14.4-pre-050729!
> ;; having already loaded asdf, etc..
> ;;
> ? (trace make-package gensym)
> NIL
> ? (require :lisppaste)
> Calling (GENSYM "ASDF")
> GENSYM returned #:ASDF4
> Calling (MAKE-PACKAGE #:ASDF4 :USE (:CL :ASDF))
> MAKE-PACKAGE returned #<Package "ASDF4">
> Calling (MAKE-PACKAGE "LISPPASTE-SYSTEM" :USE NIL :INTERNAL-SIZE 60 
> :EXTERNAL-SIZE 1)
> MAKE-PACKAGE returned #<Package "LISPPASTE-SYSTEM">
> Calling (GENSYM "ASDF")
> GENSYM returned #:ASDF5
> Calling (MAKE-PACKAGE #:ASDF5 :USE (:CL :ASDF))
> MAKE-PACKAGE returned #<Package "ASDF5">
> ...
>
>
> not sure exactly the problem -- *gensym-counter* being 0 in
> the image, the asdf and asdf1 packages existing in the image,
> or the fact that asdf uses gensym to name packages.
>
> i think this only recently started happening.
>
>      ...bryan
>
> _______________________________________________
> Bug-openmcl mailing list
> Bug-openmcl at clozure.com
> http://clozure.com/mailman/listinfo/bug-openmcl
>
>


More information about the Bug-openmcl mailing list