[cffi-devel] CFFI::CANONICALIZE with arguments (NIL)
Lou Vanek
vanek at acd.net
Tue May 16 23:53:25 UTC 2006
I'm a glutton for punishment:
. latest darcs cffi source code (about an hour old)
. latest stable clisp (January 2006, cygwin version)
. cygwin (latest version) hosted on windows xp sp2
. mysql 4.1.12
. latest clsql 3.6.1 (a few hours old)
I'm trying to get all of these to play nice but the clsql
tutorial example (clsql-tutorial-mysql.lisp) dies during compilation
of clsql/db-mysql/mysql-api.lisp. The trace is below.
I'm using uffi-compat.lisp.
I'm trying to load "ctm" which is just a link to the clsql
example file clsql-tutorial-mysql.lisp.
*compile-print* and *load-print* are turned on for greater
viewing pleasure.
I'm aware clsql doesn't officially support clisp (especially
on windows) but I'm hoping somebody got this to work. All
the DLLs load.
Can anybody tell me whether this is a cffi or a clsql or
a platform issue? Please holler if there's more info I can
provide.
Thanks
P.S. I tried SBCL but it's still too unstable on windows.
I believe the first struct (in mysql-api.lisp) is being compiled when the error
occurs. This is what the def-struct macro / NOTICE-FOREIGN-STRUCT-DEFINITION
function is choking on:
(uffi:def-struct mysql-net
(vio :pointer-void)
(fd mysql-socket)
(fcntl :int)
(buff (* :unsigned-char))
(buff-end (* :unsigned-char))
(write-pos (* :unsigned-char))
(read-pos (* :unsigned-char))
(last-error (:array :char 200))
(last-errno :unsigned-int)
(max-packet :unsigned-int)
(timeout :unsigned-int)
(pkt-nr :unsigned-int)
(error mysql-bool)
(return-errno mysql-bool)
(compress mysql-bool)
(no-send-ok mysql-bool)
(remain-in-buf :unsigned-long)
(length :unsigned-long)
(buf-length :unsigned-long)
(where-b :unsigned-long)
(return-status (* :unsigned-int))
(reading-or-writing :unsigned-char)
(save-char :char))
...
;; Loaded file
/usr/local/asdf-install/site/clsql-3.6.1/db-mysql/mysql-client-info.fas
;; Compiling file
/usr/local/asdf-install/site/clsql-3.6.1/db-mysql/mysql-api.lisp ...
; (IN-PACKAGE #:MYSQL)
; (CFFI-UFFI-COMPAT:DEF-FOREIGN-TYPE MYSQL-SOCKET :INT)
; (CFFI-UFFI-COMPAT:DEF-FOREIGN-TYPE MYSQL-BOOL :BYTE)
; (CFFI-UFFI-COMPAT:DEF-FOREIGN-TYPE MYSQL-BYTE :UNSIGNED-CHAR)
; (CFFI-UFFI-COMPAT:DEF-ENUM MYSQL-NET-TYPE (:TCP-IP :SOCKET :NAMED-PIPE))
; (CFFI-UFFI-COMPAT:DEF-STRUCT MYSQL-NET (VIO :POINTER-VOID) ...)
*** - NO-APPLICABLE-METHOD: When calling #<STANDARD-GENERIC-FUNCTION
CFFI::CANONICALIZE> with arguments (NIL), no method is
applicable.
The following restarts are available:
RETRY :R1 try calling CFFI::CANONICALIZE again
RETURN :R2 specify return values
RETRY :R3 Retry performing #<ASDF:COMPILE-OP NIL #x007A79CD> on
#<ASDF:CL-SOURCE-FILE "mysql-api" #x008BA485>.
ACCEPT :R4 Continue, treating #<ASDF:COMPILE-OP NIL #x007A79CD> on
#<ASDF:CL-SOURCE-FILE "mysql-api" #x008BA485> as having been successful.
SKIP :R5 skip (CASE *TUTORIAL-DATABASE-TYPE* # ...)
STOP :R6 stop loading file
/usr/local/asdf-install/site/clsql-3.6.1/examples/clsql-tutorial-mysql.lisp
SKIP :R7 skip (LOAD ctm)
STOP :R8 stop loading file /home/Lou_Vanek/.clisprc.lisp
ABORT :R9 ABORT
Break 1 MYSQL[2]> :bt1
<1> #<SYSTEM-FUNCTION EXT:SHOW-STACK> 3
<2> #<COMPILED-FUNCTION SYSTEM::PRINT-BACKTRACE>
<3> #<COMPILED-FUNCTION SYSTEM::DEBUG-BACKTRACE>
<4> #<COMPILED-FUNCTION SYSTEM::DEBUG-BACKTRACE-1>
<5> #<SYSTEM-FUNCTION SYSTEM::READ-EVAL-PRINT> 2
<6> #<COMPILED-FUNCTION SYSTEM::BREAK-LOOP-2-2>
<7> #<SYSTEM-FUNCTION SYSTEM::SAME-ENV-AS> 2
<8> #<COMPILED-FUNCTION SYSTEM::BREAK-LOOP-2>
<9> #<SYSTEM-FUNCTION SYSTEM::DRIVER>
- #<CLOS:METHOD-CALL-TYPE-ERROR #x006BFBC9>
- NIL
<10> #<COMPILED-FUNCTION SYSTEM::BREAK-LOOP>
- #<CLOS:METHOD-CALL-TYPE-ERROR #x006BFBC9>
<11> #<SYSTEM-FUNCTION INVOKE-DEBUGGER> 1
frame binding variables (~ = dynamically):
| ~ SYSTEM::*PRIN-STREAM* <--> #<UNBOUND>
frame binding variables (~ = dynamically):
| ~ *PRINT-READABLY* <--> NIL
frame binding variables (~ = dynamically):
| ~ *PRINT-ESCAPE* <--> T
- #<CLOS:METHOD-CALL-TYPE-ERROR #x006BFBC9>
<12> #<SYSTEM-FUNCTION ERROR>
frame binding variables (~ = dynamically):
| ~ SYSTEM::*CONDITION-RESTARTS* <--> NIL
frame binding variables (~ = dynamically):
| ~ SYSTEM::*ACTIVE-RESTARTS* <-->
(#S(RESTART :NAME ASDF:RETRY :TEST #<COMPILED-FUNCTION
SYSTEM::DEFAULT-RESTART-TEST> :INVOKE-TAG NIL
:INVOKE-FUNCTION #<FUNCTION :LAMBDA (&REST SYSTEM::ARGUMENTS) (SETQ #:G3623
SYSTEM::ARGUMENTS) (GO #:G3620)>
:REPORT #<FUNCTION :LAMBDA (ASDF::S) (FORMAT ASDF::S "~@<Retry performing ~S
on ~S.~@:>" ASDF::OP ASDF:COMPONENT)>
:INTERACTIVE #<COMPILED-FUNCTION SYSTEM::DEFAULT-RESTART-INTERACTIVE>
:MEANINGFULP T)
#S(RESTART :NAME ASDF:ACCEPT :TEST #<COMPILED-FUNCTION
SYSTEM::DEFAULT-RESTART-TEST> :INVOKE-TAG NIL
:INVOKE-FUNCTION #<FUNCTION :LAMBDA (&REST SYSTEM::ARGUMENTS) (SETQ #:G3623
SYSTEM::ARGUMENTS) (GO #:G3621)>
:REPORT
#<FUNCTION :LAMBDA (ASDF::S)
(FORMAT ASDF::S
"~@<Continue, treating ~S on ~S as ~
having been successful.~@:>"
ASDF::OP ASDF:COMPONENT)>
:INTERACTIVE #<COMPILED-FUNCTION SYSTEM::DEFAULT-RESTART-INTERACTIVE>
:MEANINGFULP T)
#S(RESTART :NAME SYSTEM::SKIP :TEST #<COMPILED-FUNCTION
SYSTEM::DEFAULT-RESTART-TEST> :INVOKE-TAG NIL
:INVOKE-FUNCTION #<COMPILED-FUNCTION SYSTEM::EVAL-LOADED-FORM-1> :REPORT
#<COMPILED-FUNCTION SYSTEM::EVAL-LOADED-FORM-2>
:INTERACTIVE #<COMPILED-FUNCTION SYSTEM::DEFAULT-RESTART-INTERACTIVE>
:MEANINGFULP T)
#S(RESTART :NAME SYSTEM::STOP :TEST #<COMPILED-FUNCTION
SYSTEM::DEFAULT-RESTART-TEST> :INVOKE-TAG NIL
:INVOKE-FUNCTION #<COMPILED-FUNCTION SYSTEM::EVAL-LOADED-FORM-3> :REPORT
#<COMPILED-FUNCTION SYSTEM::EVAL-LOADED-FORM-4>
:INTERACTIVE #<COMPILED-FUNCTION SYSTEM::DEFAULT-RESTART-INTERACTIVE>
:MEANINGFULP T)
#S(RESTART :NAME SYSTEM::SKIP :TEST #<COMPILED-FUNCTION
SYSTEM::DEFAULT-RESTART-TEST> :INVOKE-TAG NIL
:INVOKE-FUNCTION #<COMPILED-FUNCTION SYSTEM::EVAL-LOADED-FORM-1> :REPORT
#<COMPILED-FUNCTION SYSTEM::EVAL-LOADED-FORM-2>
:INTERACTIVE #<COMPILED-FUNCTION SYSTEM::DEFAULT-RESTART-INTERACTIVE>
:MEANINGFULP T)
#S(RESTART :NAME SYSTEM::STOP :TEST #<COMPILED-FUNCTION
SYSTEM::DEFAULT-RESTART-TEST> :INVOKE-TAG NIL
:INVOKE-FUNCTION #<COMPILED-FUNCTION SYSTEM::EVAL-LOADED-FORM-3> :REPORT
#<COMPILED-FUNCTION SYSTEM::EVAL-LOADED-FORM-4>
:INTERACTIVE #<COMPILED-FUNCTION SYSTEM::DEFAULT-RESTART-INTERACTIVE>
:MEANINGFULP T)
#S(RESTART :NAME ABORT :TEST #<COMPILED-FUNCTION SYSTEM::DEFAULT-RESTART-TEST>
:INVOKE-TAG NIL
:INVOKE-FUNCTION #<COMPILED-FUNCTION SYSTEM::MAIN-LOOP-1-1> :REPORT NIL
:INTERACTIVE #<COMPILED-FUNCTION SYSTEM::DEFAULT-RESTART-INTERACTIVE>
:MEANINGFULP T))
compiled tagbody frame for #(NIL NIL)
- 93
- 107
- #(#(NIL #<STANDARD-GENERIC-FUNCTION CFFI::CANONICALIZE>) NIL)
- #(NIL #<STANDARD-GENERIC-FUNCTION CFFI::CANONICALIZE>)
- #<COMPILED-FUNCTION SYSTEM::RETRY-FUNCTION-CALL>
- (NIL)
- #<STANDARD-GENERIC-FUNCTION CFFI::CANONICALIZE>
- #<CLOS:METHOD-CALL-TYPE-ERROR #x006BFBC9>
<13> #<COMPILED-FUNCTION SYSTEM::RETRY-FUNCTION-CALL>
- 0
-
(#<STANDARD-METHOD (#<STANDARD-CLASS CFFI::FOREIGN-STRUCT-TYPE>)>
#<STANDARD-METHOD (#<STANDARD-CLASS CFFI::FOREIGN-TYPE-ALIAS>)>
#<STANDARD-METHOD (#<STANDARD-CLASS CFFI::FOREIGN-POINTER-TYPE>)>
#<STANDARD-METHOD (#<STANDARD-CLASS CFFI::FOREIGN-BUILT-IN-TYPE>)>)
- #<COMPILED-FUNCTION #:|87 107 (DEFGENERIC NO-APPLICABLE-METHOD (GF &REST ARGS)
...)-9-1|>
- (NIL)
- #<STANDARD-GENERIC-FUNCTION CFFI::CANONICALIZE>
<14> #<COMPILED-FUNCTION #:|87 107 (DEFGENERIC NO-APPLICABLE-METHOD (GF &REST
ARGS) ...)-9-1|>
<15> #<STANDARD-GENERIC-FUNCTION NO-APPLICABLE-METHOD>
<16> #<STANDARD-GENERIC-FUNCTION NO-APPLICABLE-METHOD>
- NO-APPLICABLE-METHOD
- #<COMPILED-FUNCTION CLOS::NO-METHOD-CALLER-1>
- (NIL)
<17> #<COMPILED-FUNCTION CLOS::NO-METHOD-CALLER-1>
<18> #<STANDARD-GENERIC-FUNCTION CFFI::CANONICALIZE>
- #<COMPILED-FUNCTION #:|267 269 (DEFMETHOD CANONICALIZE (#) ...)-41-1-1|>
- #<CFFI-UFFI-COMPAT::UFFI-ARRAY-TYPE #:ANONYMOUS-CFFI-TYPE7352>
<19> #<COMPILED-FUNCTION #:|267 269 (DEFMETHOD CANONICALIZE (#) ...)-41-1-1|>
<20> #<STANDARD-GENERIC-FUNCTION CFFI::CANONICALIZE>
- #<COMPILED-FUNCTION CFFI::CANONICALIZE-FOREIGN-TYPE>
- (CFFI-UFFI-COMPAT::UFFI-ARRAY (CFFI-UFFI-COMPAT::UFFI-CHAR :CHAR) 200)
<21> #<COMPILED-FUNCTION CFFI::CANONICALIZE-FOREIGN-TYPE>
- NIL
- 1
- NIL
- (CFFI-UFFI-COMPAT::UFFI-ARRAY (CFFI-UFFI-COMPAT::UFFI-CHAR :CHAR) 200)
- LAST-ERROR
- (LAST-ERROR (CFFI-UFFI-COMPAT::UFFI-ARRAY (CFFI-UFFI-COMPAT::UFFI-CHAR :CHAR)
200))
-
((LAST-ERROR (CFFI-UFFI-COMPAT::UFFI-ARRAY (CFFI-UFFI-COMPAT::UFFI-CHAR :CHAR)
200)) (LAST-ERRNO :UNSIGNED-INT)
(MAX-PACKET :UNSIGNED-INT) (TIMEOUT :UNSIGNED-INT) (PKT-NR :UNSIGNED-INT)
(ERROR MYSQL-BOOL) (RETURN-ERRNO MYSQL-BOOL)
(COMPRESS MYSQL-BOOL) (NO-SEND-OK MYSQL-BOOL) (REMAIN-IN-BUF :UNSIGNED-LONG)
(LENGTH :UNSIGNED-LONG)
(BUF-LENGTH :UNSIGNED-LONG) (WHERE-B :UNSIGNED-LONG) (RETURN-STATUS :POINTER)
(READING-OR-WRITING (CFFI-UFFI-COMPAT::UFFI-CHAR :UNSIGNED-CHAR)) (SAVE-CHAR
(CFFI-UFFI-COMPAT::UFFI-CHAR :CHAR)))
- NIL
- 4
- 28
- #<CFFI::FOREIGN-STRUCT-TYPE MYSQL-NET>
- NIL
- NIL
- MYSQL-NET
- (MYSQL-NET)
- #<COMPILED-FUNCTION CFFI::NOTICE-FOREIGN-STRUCT-DEFINITION>
-
((VIO :POINTER) (FD MYSQL-SOCKET) (FCNTL :INT) (BUFF :POINTER) (BUFF-END
:POINTER) (WRITE-POS :POINTER) (READ-POS :POINTER)
(LAST-ERROR (CFFI-UFFI-COMPAT::UFFI-ARRAY (CFFI-UFFI-COMPAT::UFFI-CHAR :CHAR)
200)) (LAST-ERRNO :UNSIGNED-INT)
(MAX-PACKET :UNSIGNED-INT) (TIMEOUT :UNSIGNED-INT) (PKT-NR :UNSIGNED-INT)
(ERROR MYSQL-BOOL) (RETURN-ERRNO MYSQL-BOOL)
(COMPRESS MYSQL-BOOL) (NO-SEND-OK MYSQL-BOOL) (REMAIN-IN-BUF :UNSIGNED-LONG)
(LENGTH :UNSIGNED-LONG)
(BUF-LENGTH :UNSIGNED-LONG) (WHERE-B :UNSIGNED-LONG) (RETURN-STATUS :POINTER)
(READING-OR-WRITING (CFFI-UFFI-COMPAT::UFFI-CHAR :UNSIGNED-CHAR)) (SAVE-CHAR
(CFFI-UFFI-COMPAT::UFFI-CHAR :CHAR)))
- MYSQL-NET
<22> #<COMPILED-FUNCTION CFFI::NOTICE-FOREIGN-STRUCT-DEFINITION>
- #<COMPILED-FUNCTION CFFI::NOTICE-FOREIGN-STRUCT-DEFINITION>
EVAL frame for form
(CFFI::NOTICE-FOREIGN-STRUCT-DEFINITION 'MYSQL-NET
'((VIO :POINTER) (FD MYSQL-SOCKET) (FCNTL :INT) (BUFF :POINTER) (BUFF-END
:POINTER) (WRITE-POS :POINTER) (READ-POS :POINTER)
(LAST-ERROR (CFFI-UFFI-COMPAT::UFFI-ARRAY (CFFI-UFFI-COMPAT::UFFI-CHAR :CHAR)
200)) (LAST-ERRNO :UNSIGNED-INT)
(MAX-PACKET :UNSIGNED-INT) (TIMEOUT :UNSIGNED-INT) (PKT-NR :UNSIGNED-INT)
(ERROR MYSQL-BOOL) (RETURN-ERRNO MYSQL-BOOL)
(COMPRESS MYSQL-BOOL) (NO-SEND-OK MYSQL-BOOL) (REMAIN-IN-BUF :UNSIGNED-LONG)
(LENGTH :UNSIGNED-LONG)
(BUF-LENGTH :UNSIGNED-LONG) (WHERE-B :UNSIGNED-LONG) (RETURN-STATUS :POINTER)
(READING-OR-WRITING (CFFI-UFFI-COMPAT::UFFI-CHAR :UNSIGNED-CHAR)) (SAVE-CHAR
(CFFI-UFFI-COMPAT::UFFI-CHAR :CHAR))))
- NIL
<23> #<SPECIAL-OPERATOR PROGN>
EVAL frame for form
(PROGN
(CFFI::NOTICE-FOREIGN-STRUCT-DEFINITION 'MYSQL-NET
'((VIO :POINTER) (FD MYSQL-SOCKET) (FCNTL :INT) (BUFF :POINTER) (BUFF-END
:POINTER) (WRITE-POS :POINTER) (READ-POS :POINTER)
(LAST-ERROR (CFFI-UFFI-COMPAT::UFFI-ARRAY (CFFI-UFFI-COMPAT::UFFI-CHAR
:CHAR) 200)) (LAST-ERRNO :UNSIGNED-INT)
(MAX-PACKET :UNSIGNED-INT) (TIMEOUT :UNSIGNED-INT) (PKT-NR :UNSIGNED-INT)
(ERROR MYSQL-BOOL) (RETURN-ERRNO MYSQL-BOOL)
(COMPRESS MYSQL-BOOL) (NO-SEND-OK MYSQL-BOOL) (REMAIN-IN-BUF :UNSIGNED-LONG)
(LENGTH :UNSIGNED-LONG)
(BUF-LENGTH :UNSIGNED-LONG) (WHERE-B :UNSIGNED-LONG) (RETURN-STATUS :POINTER)
(READING-OR-WRITING (CFFI-UFFI-COMPAT::UFFI-CHAR :UNSIGNED-CHAR)) (SAVE-CHAR
(CFFI-UFFI-COMPAT::UFFI-CHAR :CHAR)))))
frame binding environments
VAR_ENV <--> #<ADDRESS #x1918084C>
FUN_ENV <-->
#(NEXT-METHOD-P
#<FUNCTION-MACRO
#<FUNCTION NEXT-METHOD-P (SYSTEM::<MACRO-FORM> SYSTEM::<ENV-ARG>) (DECLARE
(CONS SYSTEM::<MACRO-FORM>))
(DECLARE (IGNORE SYSTEM::<ENV-ARG>))
(IF (> (EXT:LIST-LENGTH-DOTTED SYSTEM::<MACRO-FORM>) 1)
(SYSTEM::MACRO-CALL-ERROR SYSTEM::<MACRO-FORM>)
(LET* NIL (BLOCK NEXT-METHOD-P '#:G3549)))>
#<FUNCTION NEXT-METHOD-P NIL #:G3549>>
CALL-NEXT-METHOD
#<FUNCTION-MACRO
#<FUNCTION CALL-NEXT-METHOD (SYSTEM::<MACRO-FORM> SYSTEM::<ENV-ARG>)
(DECLARE (CONS SYSTEM::<MACRO-FORM>))
(DECLARE (IGNORE SYSTEM::<ENV-ARG>))
(LET* ((CLOS::NEW-ARG-EXPRS (CDR SYSTEM::<MACRO-FORM>)))
(BLOCK CALL-NEXT-METHOD
(IF CLOS::NEW-ARG-EXPRS
(LIST 'IF '(EVAL-WHEN (EVAL) T)
(LIST 'CLOS::%CALL-NEXT-METHOD '#:G3548 '#:G3549 (LIST 'LIST '#:G3550
'#:G3551) (CONS 'LIST CLOS::NEW-ARG-EXPRS))
(LIST 'IF '#:G3549 (LIST* 'FUNCALL '#:G3549 CLOS::NEW-ARG-EXPRS)
(LIST* 'CLOS::%NO-NEXT-METHOD '#:G3548 CLOS::NEW-ARG-EXPRS)))
(LIST 'IF '#:G3549 (LIST 'FUNCALL '#:G3549 '#:G3550 '#:G3551)
(LIST 'CLOS::%NO-NEXT-METHOD '#:G3548 '#:G3550 '#:G3551)))))>
#<FUNCTION CALL-NEXT-METHOD (&REST CLOS::NEW-ARGS)
(IF CLOS::NEW-ARGS
(IF (EVAL-WHEN (EVAL) T) (CLOS::%CALL-NEXT-METHOD #:G3548 #:G3549 (LIST
#:G3550 #:G3551) CLOS::NEW-ARGS)
(IF #:G3549 (APPLY #:G3549 CLOS::NEW-ARGS) (APPLY
#'CLOS::%NO-NEXT-METHOD #:G3548 CLOS::NEW-ARGS)))
(IF #:G3549 (FUNCALL #:G3549 #:G3550 #:G3551) (CLOS::%NO-NEXT-METHOD
#:G3548 #:G3550 #:G3551)))>>
NIL)
BLOCK_ENV <--> NIL
GO_ENV <--> NIL
DECL_ENV <--> ((DECLARATION OPTIMIZE DECLARATION))
<24> #<SYSTEM-FUNCTION EVAL>
-
(PROGN
(CFFI::NOTICE-FOREIGN-STRUCT-DEFINITION 'MYSQL-NET
...
More information about the cffi-devel
mailing list