[Gsll-devel] status.text & clisp

Sam Steingold sds at gnu.org
Tue Aug 10 17:36:48 UTC 2010


Hi Liam,

On 8/7/10, Liam Healy <lhealy at common-lisp.net> wrote:
>  On Wed, Jul 28, 2010 at 3:04 PM, Sam Steingold <sds at gnu.org> wrote:
>  > I don't know what "execution errors" are (probably things like
>  > FUNCALL: undefined function NIL
>
> Yes, stuff like that.  I noticed similar errors when I
>  last tested on CLISP.  At some point I'll try a new
>  CLISP build and see if it's possible to knock these
>  down a bit.  I recommend the following technique for
>  debugging when you see e.g. test FOO failing,
>
>  (lisp-unit:use-debugger)  ; once only, will give you debugger on error
>  (lisp-unit:run-test foo)

    MATRIX-PRODUCT:
FUNCALL: undefined function NIL
    MATRIX-PRODUCT-HERMITIAN:
FUNCALL: undefined function NIL
    MATRIX-PRODUCT-NONSQUARE:
FUNCALL: undefined function NIL
    MATRIX-PRODUCT-TRIANGULAR:
FUNCALL: undefined function NIL
    MATRIX-SET-ALL:
FUNCALL: undefined function NIL
    SCALE:
FUNCALL: undefined function NIL
    TDIST:
FFI::FOREIGN-CALL-OUT: floating point overflow
    VECTOR-SET-ALL:
FUNCALL: undefined function NIL
TOTAL: 3501 assertions passed, 15 failed, 14 execution errors.

1.     VECTOR-SET-ALL:
FUNCALL: undefined function NIL

*** - FUNCALL: undefined function NIL
Break 1 GSL[3]> :w
[197] EVAL frame for form (SET-ALL V1 #C(-34.5 8.24))
Break 1 GSL[3]> :bt
<13/200> #<COMPILED-FUNCTION #:|49 60 (DEFMFUN SET-ALL (# VALUE) ...)-4-1-3|>
<14/200> #<STANDARD-GENERIC-FUNCTION SET-ALL>
[197] EVAL frame for form (SET-ALL V1 #C(-34.5 8.24))
Break 1 GSL[3]> v1
#4m(#C(0.0 0.0) #C(0.0 0.0) #C(0.0 0.0))
Break 1 GSL[3]> (type-of *)
GRID:VECTOR-COMPLEX-SINGLE-FLOAT

(disassemble (slot-value (nth 20 (CLOS:GENERIC-FUNCTION-METHODS
#'SET-ALL)) 'CLOS::$FAST-FUNCTION))

Disassembly of function #:|49 60 (DEFMFUN SET-ALL (# VALUE) ...)-4-1-4|
(CONST 0) = #:|gsl_vector_complex_set_all|
(CONST 1) = FOREIGN-STRUCTURES-BY-VALUE::PREPARED
(CONST 2) = MPOINTER
2 required arguments
0 optional arguments
No rest parameter
No keyword parameters
10 byte-code instructions:
0     (CONST&PUSH 0)                      ; #:|gsl_vector_complex_set_all|
1     (CONST&PUSH 1)                      ;
FOREIGN-STRUCTURES-BY-VALUE::PREPARED
2     (PUSH-UNBOUND 1)
4     (CALLS2&PUSH 158)                   ; GET
6     (LOAD&PUSH 3)
7     (CALL1&PUSH 2)                      ; MPOINTER
9     (LOAD&PUSH 3)
10    (FUNCALL 2)
12    (LOAD 2)
13    (SKIP&RET 3)
NIL

(symbol-plist (sys::closure-const (slot-value (nth 20
(CLOS:GENERIC-FUNCTION-METHODS #'SET-ALL)) 'CLOS::$FAST-FUNCTION) 0))
NIL

i.e., the method FUNCALLs the property of the uninterned symbol which is NIL.

(dolist (m (CLOS:GENERIC-FUNCTION-METHODS #'SET-ALL))
   (let ((c (sys::closure-consts (slot-value m 'CLOS::$FAST-FUNCTION))))
     (unless (symbol-package (car c)) (print (list m c)))))

(#<STANDARD-METHOD
   (#<STANDARD-CLASS GRID:MATRIX-COMPLEX-DOUBLE-FLOAT> #<BUILT-IN-CLASS T>)>
 (#:|gsl_matrix_complex_set_all| FOREIGN-STRUCTURES-BY-VALUE::PREPARED
  MPOINTER))
(#<STANDARD-METHOD
   (#<STANDARD-CLASS GRID:MATRIX-COMPLEX-SINGLE-FLOAT> #<BUILT-IN-CLASS T>)>
 (#:|gsl_matrix_complex_float_set_all| FOREIGN-STRUCTURES-BY-VALUE::PREPARED
  MPOINTER))
(#<STANDARD-METHOD
   (#<STANDARD-CLASS GRID:VECTOR-COMPLEX-DOUBLE-FLOAT> #<BUILT-IN-CLASS T>)>
 (#:|gsl_vector_complex_set_all| FOREIGN-STRUCTURES-BY-VALUE::PREPARED
  MPOINTER))
(#<STANDARD-METHOD
   (#<STANDARD-CLASS GRID:VECTOR-COMPLEX-SINGLE-FLOAT> #<BUILT-IN-CLASS T>)>
 (#:|gsl_vector_complex_float_set_all| FOREIGN-STRUCTURES-BY-VALUE::PREPARED
  MPOINTER))

i.e., the complex vectors and matrices do not work.

why?

2. MATRIX-SET-ALL same story
[399] EVAL frame for form (SET-ALL M1 #C(-34.5 8.24))
Break 2 GSL[4]> (type-of m1)
GRID:MATRIX-COMPLEX-SINGLE-FLOAT

3. matrix-product:
(disassemble (slot-value (first (CLOS:GENERIC-FUNCTION-METHODS
#'matrix-product)) 'CLOS::$FAST-FUNCTION))
Disassembly of function #:|32 53 (DEFMFUN MATRIX-PRODUCT (# #
&OPTIONAL ...) ...)-3-4-1-1|
==>
(funcall (get '#:|gsl_blas_zgemm| 'FOREIGN-STRUCTURES-BY-VALUE::PREPARED))

4.  (lisp-unit:run-tests scale)
    SCALE:
FUNCALL: undefined function NIL

*** - FUNCALL: undefined function NIL
Break 4 GSL[7]> :w
[825] EVAL frame for form (SCALE SCALAR V1)
Break 4 GSL[7]> scalar
#C(32.5 42.73)
Break 4 GSL[7]> v1
#4m(#C(-34.5 8.24) #C(3.29 -8.93) #C(34.12 -6.15) #C(49.27 -13.49)
 #C(32.5 42.73) #C(-17.24 43.31) #C(-16.12 -8.25) #C(21.44 -49.08))
Break 4 GSL[7]> (type-of *)
GRID:VECTOR-COMPLEX-SINGLE-FLOAT
Break 4 GSL[7]> (describe #'scale)

#<STANDARD-GENERIC-FUNCTION SCALE> is a generic function.
Argument list: (ALPHA X)
Methods:
(FLOAT GRID:VECTOR-COMPLEX-DOUBLE-FLOAT)
(FLOAT GRID:VECTOR-COMPLEX-SINGLE-FLOAT)
(COMPLEX GRID:VECTOR-COMPLEX-DOUBLE-FLOAT)
(COMPLEX GRID:VECTOR-COMPLEX-SINGLE-FLOAT)
(FLOAT GRID:VECTOR-DOUBLE-FLOAT)
(FLOAT GRID:VECTOR-SINGLE-FLOAT)

Break 4 GSL[7]> (disassemble (slot-value (third
(CLOS:GENERIC-FUNCTION-METHODS #'scale)) 'CLOS::$FAST-FUNCTION))

Disassembly of function #:|127 138 (DEFMFUN SCALE (# #) ...)-11-1-4|
(CONST 0) = #:|gsl_blas_zscal|
(CONST 1) = FOREIGN-STRUCTURES-BY-VALUE::PREPARED
(CONST 2) = MPOINTER
2 required arguments
0 optional arguments
No rest parameter
No keyword parameters
10 byte-code instructions:
0     (CONST&PUSH 0)                      ; #:|gsl_blas_zscal|
1     (CONST&PUSH 1)                      ;
FOREIGN-STRUCTURES-BY-VALUE::PREPARED
2     (PUSH-UNBOUND 1)
4     (CALLS2&PUSH 158)                   ; GET
6     (LOAD&PUSH 3)
7     (LOAD&PUSH 3)
8     (CALL1&PUSH 2)                      ; MPOINTER
10    (FUNCALL 2)
12    (LOAD 1)
13    (SKIP&RET 3)
NIL
Break 4 GSL[7]>

i.e., again
(funcall (get '#:|gsl_blas_zscal| 'FOREIGN-STRUCTURES-BY-VALUE::PREPARED)...)

5. (lisp-unit:run-tests tdist)
    TDIST:
FFI::FOREIGN-CALL-OUT: floating point overflow

*** - FFI::FOREIGN-CALL-OUT: floating point overflow
Break 5 GSL[8]> :w
[1019] EVAL frame for form (TDIST-PINV 1.0d0 300.0d0)
Break 5 GSL[8]> (describe #'TDIST-PINV)

#<COMPILED-FUNCTION TDIST-PINV> is a compiled function.
Argument list: (P NU)
Documentation:
The inverse cumulative distribution functions
P(x) for the tdist distribution with nu degrees of freedom.
For more information, evaluate (DISASSEMBLE #'TDIST-PINV).

Break 5 GSL[8]> (DISASSEMBLE #'TDIST-PINV)

Disassembly of function TDIST-PINV
(CONST 0) = #<FOREIGN-FUNCTION "gsl_cdf_tdist_Pinv" #x00002B6F431FECC0>
2 required arguments
0 optional arguments
No rest parameter
No keyword parameters
6 byte-code instructions:
0     (CONST&PUSH 0)                      ; #
1     (LOAD&PUSH 3)
2     (LOAD&PUSH 3)
3     (FUNCALL 2)
5     (VALUES1)
6     (SKIP&RET 3)
NIL

running under gdb indicates that the machine double being converted to
lisp is an "inf", so the overflow is expected...


-- 
Sam Steingold <http://sds.podval.org>




More information about the gsll-devel mailing list