Subject: [clisp-list] question about package locks (ext:without-package-lock)

From: Christian Schuhegger <[email-masked]>
Date: Tue Jan 6 09:29:06 2004

hello,

i am trying to run some code that uses the function
clos::slot-boundp-using-class on clisp 2.29. when i enter:
[39]> #'clos::slot-boundp-using-class
** - Continuable Error
INTERN("SLOT-BOUNDP-USING-CLASS"): #<PACKAGE CLOS> is locked
If you continue (by typing 'continue'): Ignore the lock and proceed
1. Break [40]>

here is my first question: i am not calling one of:
     *  import a symbol into the package (with import and shadowing-import)
     * export a symbol from the package (with export).
     * unexport a symbol (with unexport)
     * change the name of the package (with rename-package).
     * change the packages used by the package (with use-package and 
unuse-package).
     * unintern a symbol in the package (with unintern)
     * shadow a symbol (with shadow or shadowing-import).
i just want to know from the system that this is a function? so why is 
it triggering this "is locked" error?

then my next attempt was to use ext:without-package-lock as described at 
http://clisp.cons.org/impnotes/packages.html:
[44]> (ext:without-package-lock ("CLOS") #'clos::slot-boundp-using-class)
** - Continuable Error
INTERN("SLOT-BOUNDP-USING-CLASS"): #<PACKAGE CLOS> is locked
If you continue (by typing 'continue'): Ignore the lock and proceed
1. Break [45]>
so my next question is why the without-package-lock does not work?

i found in the common music project a file which defines the following:
#+(and clisp (not pcl))
(progn
   ;(defun allocate-instance (class)
   ;  (clos::allocate-std-instance
   ;   class (length (class-slots class))))
   (defun class-slots (class)
     (clos::class-slots class))
   (defun class-precedence-list (class)
     (clos::class-precedence-list class))
   (defun class-direct-superclasses (class)
     (clos::class-direct-superclasses class))
   (defun slot-definition-name (slot)
     (clos::slotdef-name slot))
   (defun slot-definition-initargs (slot)
     (clos::slotdef-initargs slot))
   (defun slot-definition-initform (slot)
     (let ((? (clos::slotdef-initer slot)))
       (and ? (if (car ?) (funcall (car ?)) (cdr ?)))))
   (defun slot-definition-readers (slot)
     (declare (ignore slot))
     (error "slot-definition-readers undefined in CLISP"))
   (defun slot-definition-writers (slot)
     (declare (ignore slot))
     (error "slot-definition-writers undefined in CLISP"))
   (defmacro slot-value-using-class (class object slot)
     (declare (ignore class))
     `(slot-value ,object (slot-definition-name ,slot)))
   (defun slot-boundp-using-class (class object slot)
     (declare (ignore class))
     (slot-boundp object (slot-definition-name slot)))
   (defun slot-makunbound-using-class (class object slot)
     (declare (ignore class))
     (slot-makunbound object (slot-definition-name slot)))
   (defun change-class (object new-class)
     (declare (ignore object new-class))
     (error "CLISP CLOS does not implement change-class."))
   (defvar %clisp-prototypes% (make-hash-table))
   (defun class-prototype (class)
     (or (gethash class %clisp-prototypes% )
         (setf (gethash class %clisp-prototypes% )
               (clos::allocate-std-instance
                class (length (class-slots class))))))
)

which means for me that i should use in clisp slot-boundp instead of 
clos::slot-boundp-using-class. the same for slot-value-using-class.

could somebody please bring some more light into this matter?

thanks a lot for any hints!!
-- 
Christian Schuhegger

---

From: Sam Steingold <[email-masked]>
Date: Tue Jan 6 09:58:03 2004

> * Christian Schuhegger <[email-masked]> [2004-01-06 18:25:56 +0100]:
>

you are 3 releases behind.

> it triggering this "is locked" error?

read the error message again.
you are trying to INTERN "SLOT-BOUNDP-USING-CLASS" in package CLOS.

> so my next question is why the without-package-lock does not work?

this is a read-time error, it is signaled before
EXT:WITHOUT-PACKAGE-LOCK is ever processed.

try FIND-SYMBOL or FIND-ALL-SYMBOLS

>                 class (length (class-slots class))))))

CLISP now has CLASS-PROTOTYPE & CHANGE-CLASS.

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.honestreporting.com>
Growing Old is Inevitable; Growing Up is Optional.

---

From: Christian Schuhegger <[email-masked]>
Date: Tue Jan 6 10:34:01 2004

> you are 3 releases behind.

yes, but at least i know that it works fine for me :) and before i don't 
have a very good reason to upgrade i will stay with this version.

> try FIND-SYMBOL or FIND-ALL-SYMBOLS

ok, thanks for that hint:
[12]> (find-all-symbols "SLOT-BOUNDP-USING-CLASS")
NIL

the symbol is just not available. it is only a strange error message :)

thanks again!
-- 
Christian Schuhegger
http://cschuheg.web1000.com

---

From: Eliot Handelman <[email-masked]>
Date: Sat Jan 10 13:19:00 2004

Hi,

I'm trying to build clisp-2.32 on fedora core 1 (older AMD K7). All goes 
well until:

test -d bindings || mkdir -p bindings
./lisp.run -B . -N locale -Efile UTF-8 -Eterminal UTF-8 -norc -m 750KW 
-x "(and (load \"init.lisp\") (sys::%saveinitmem) (ext::exit))"

*** - handle_fault error2 ! address = 0x3f292f58 not in 
[0x20810000,0x20810000) !
SIGSEGV cannot be cured. Fault address = 0x3f292f58.
make: *** [interpreted.mem] Segmentation fault

I tried to build also with -DNO_GENERATIONAL_GC,  which caused a 
segmentation fault
without the handle_fault error2.

The same problem was reported in a message from Gerard Milmeister::

Building CLISP 2.31 on Fedora Core 1 
2003-11-13 04:40

I haven't seen a follow-up?

many thanks for suggestions,

-- eliot

---

From: Sam Steingold <[email-masked]>
Date: Sat Jan 10 13:42:00 2004

> * Eliot Handelman <[email-masked]> [2004-01-10 16:18:48 -0500]:
>
> segmentation fault without the handle_fault error2.
>
> Building CLISP 2.31 on Fedora Core 1 2003-11-13 04:40

this is also what I observe.
(I also get a crash dumping GNU Emacs).
CLISP builds fine on other Linux machines (SF CF, fencepost), so this
is definitely something about Fedora.

I have no idea what is going on.
It might be related to
<https://bugzilla.fedora.us/show_bug.cgi?id=843#c14>,
might be unrelated.

Bruno?

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.honestreporting.com>
char*a="char*a=%c%s%c;main(){printf(a,34,a,34);}";main(){printf(a,34,a,34);}

---

From: Carlo Traverso <[email-masked]>
Date: Sat Jan 10 15:25:00 2004

From what I read on the Axiom developer mailing lists, some mid november
discussion, http://mail.nongnu.org/mailman/listinfo/axiom-developer it
might be a problem of the fedora memory model, used for exec-shield,
that makes it incompatible with current lisp memory management
model. Apparently the fedora developers are aware of the problem, but
insist that lisps have to change their model.

Carlo