Problems with def-clm-var

Larry Troxler lt@westnet.com
Thu, 18 Sep 1997 21:49:27 -0400 (EDT)


If I compile-load a file that contains a clm-def-var and an instrument
definition, then I find that I can not then look at the clm-var from the
top-level using the (clm-var) form - it seg-faults. However, looking at 
the clm-var before the instrument definition is loaded, works. For
example:

test3.lisp:

(def-clm-var ctr 0 "" :cleared)
(print (ctr))
(defpinstrument simp (beg end ind)
  (run 
   (loop for i from beg to end do
     (clm-print "s~D: ~D ~D" ind (ctr) (previous-ctr))
     (setf (ctr) (+ (ctr) 1))
     (outa i .01))))

..and the Lisp session:

Copyright (C) 1985-1996, Franz Inc., Berkeley, CA, USA.  All Rights
Reserved.

;; Starting socket daemon and emacs-lisp interface...
;; Optimization settings: safety 1, space 1, speed 1, debug 2.
;; For a complete description of all compiler switches given the current
;; optimization settings evaluate (EXPLAIN-COMPILER-SETTINGS).

[changing package from "COMMON-LISP-USER" to "COMMON-MUSIC"]
CM(1): :cl test3.lisp
;;; Compiling file test3.lisp
; Compiling |<load-CTR>|
; Compiling CTR
; Compiling PREVIOUS-CTR
; Compiling |setf-CTR|
; Compiling CLM::<CTR>
; Compiling CLM::|<previous-CTR>|
; Compiling CLM::|<setf-CTR>|
; Compiling (:INTERNAL (:TOP-LEVEL-FORM "test3.lisp" 0) 0)
; Compiling (:INTERNAL (:TOP-LEVEL-FORM "test3.lisp" 0) 0)
; Writing "/p2/usr/local/cm/clm_lnxacl_SIMP.c"
; Compiling "/p2/usr/local/cm/clm_lnxacl_SIMP.c"
; Creating shared object file "/p2/usr/local/cm/clm_lnxacl_SIMP.so"
; Compiling (:INTERNAL (:TOP-LEVEL-FORM "test3.lisp" 46) 0)
; Compiling SIMP
; Compiling   (:INTERNAL SIMP 0)
; Compiling   (:INTERNAL SIMP 1)
; Compiling   (FLET SIMP CLOSE-INPUT)
; Compiling   (FLET SIMP CLM-CLOSE-INPUT)
; Compiling   (FLET SIMP CLM::LOAD-IO_C)
; Compiling   (FLET SIMP CLM::LOAD-REAL-ARRAY_C)
; Compiling   (:INTERNAL SIMP 2)
; Compiling   (:INTERNAL SIMP 3)
;  Note: Closure (:INTERNAL SIMP 2) will be stack allocated.
;  Note: Closure (FLET SIMP CLM::LOAD-REAL-ARRAY_C) will be stack
allocated.
;  Note: Closure (:INTERNAL SIMP 0) will be stack allocated.
; Compiling SIMP0
;;; Writing fasl file test3.fasl
Warning: No IN-PACKAGE form seen in test3.lisp.  (Allegro Presto will be
         ineffective when loading a file having no IN-PACKAGE form.)
;;; Fasl write complete
Warning: While compiling these undefined functions were referenced:
         |clm_lnxacl_simp1|, |<load-CTR>|.
; Fast loading test3.fasl

0 
;   Foreign loading /p2/usr/local/cm/clm_lnxacl_SIMP.so.
CM(2): (ctr)
Error: Received signal number 11 (Segmentation violation)
  [condition type: SYNCHRONOUS-OPERATING-SYSTEM-SIGNAL]
[1] CM(3): 

--  Larry Troxler  --  lt@westnet.com  --  Patterson, NY USA  --