[cffi-devel] stdcall callbacks on ClozureCL/win32

Greg Santucci thecodewitch at gmail.com
Sat Jun 6 21:14:17 UTC 2009


On Sun, Jun 7, 2009 at 1:05 AM, Luís Oliveira <luismbo at gmail.com> wrote:

> On Sat, Jun 6, 2009 at 12:40 PM, Greg Santucci<thecodewitch at gmail.com>
> wrote:
> > When I run  (rt:do-test 'cffi-tests::callbacks.stdcall.1), I get this
> > printed:
> >
> > CFFI-TESTS::CALLBACKS.STDCALL.1
> >
> > and nothing more.
>
> That's good, it means the test passed.
>
>
> > When I try:
> >
> > (asdf:oos 'asdf:load-op :cffi-tests)
> > (asdf:oos 'asdf:test-op :cffi-tests)
> >
> > Clozure crashes to its kernel debugger.
>
> Can you get a backtrace? Hopefully one of the tests is triggering the
> same bug you're experiencing with GLUT which I suspect is unrelated to
> stdcall.


The transcript is in the attached file "latest-cffi-test.txt".

Greg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/cffi-devel/attachments/20090607/deea4be4/attachment.html>
-------------- next part --------------
C:\lispbox\ccl>wx86cl.exe
Welcome to Clozure Common Lisp Version 1.3  (WindowsX8632)!
? (load "init.lisp")
#P"C:/lispbox/ccl/init.lisp"
? (asdf:oos 'asdf:load-op :cffi)
; loading system definition from C:/lispbox/packages/cffi/cffi.asd into #<Package "ASDF0">
; registering #<SYSTEM CFFI #x8A74B6E> as CFFI
; loading system definition from C:/lispbox/packages/babel/babel.asd into #<Package "ASDF0">
; registering #<SYSTEM BABEL #x8AA63BE> as BABEL
; loading system definition from C:/lispbox/packages/alexandria/alexandria.asd into #<Package "ASDF0">
; registering #<SYSTEM :ALEXANDRIA #x8ADC39E> as ALEXANDRIA
; loading system definition from C:/lispbox/packages/trivial-features/trivial-features.asd into #<Package "ASDF0">
; registering #<SYSTEM TRIVIAL-FEATURES #x8A97AE6> as TRIVIAL-FEATURES
NIL
? (asdf:oos 'asdf:load-op :cffi-tests)
; loading system definition from C:/lispbox/packages/cffi/cffi-tests.asd into #<Package "ASDF0">
; registering #<SYSTEM CFFI-TESTS #x8C447D6> as CFFI-TESTS
; loading system definition from C:/lispbox/packages/rt/rt.asd into #<Package "ASDF0">
; registering #<SYSTEM :RT #x8C74996> as RT
;Compiler warnings for "C:/lispbox/packages/cffi/tests/funcall.lisp" :
;   In (EXPAND-TO-FOREIGN (T CHECK-NIL-SKIP-TYPE)): Unused lexical variable VAL
; Warning: COMPILE-FILE warned while performing #<COMPILE-OP NIL #x8C128FE> on #<CL-SOURCE-FILE "funcall" #x8C0EEC6>.
; While executing: #<STANDARD-METHOD ASDF:PERFORM (ASDF:COMPILE-OP ASDF:CL-SOURCE-FILE)>, in process listener(1).
NIL
? (asdf:oos 'asdf:test-op :cffi-tests)
;;; running tests (uncompiled)
Doing 223 pending tests of 223 tests total.
 FUNCALL.CHAR FUNCALL.INT.1 FUNCALL.INT.2 FUNCALL.LONG FUNCALL.LONG-LONG
 FUNCALL.FLOAT FUNCALL.DOUBLE FUNCALL.STRING.1 FUNCALL.STRING.2 FUNCALL.STRING.3
 FUNCALL.VARARGS.CHAR FUNCALL.VARARGS.INT FUNCALL.VARARGS.LONG
Test FUNCALL.VARARGS.DOUBLE failed
Form: (WITH-FOREIGN-POINTER-AS-STRING (S 100) (SETF (MEM-REF S :CHAR) 0) (FOREIGN-FUNCALL "sprintf" :POINTER S :STRING "%.2f" :DOUBLE (COERCE PI 'DOUBLE-FLOAT) :INT))
Expected value: "3.14"
Actual value: "".
 FUNCALL.VARARGS.STRING FUNCALL.DOUBLE26 FUNCALL.FLOAT26 FUNCALL.F-S-P.1
Test FUNCALL.STDCALL.1 failed
Form: (FLET ((FUN NIL (FOREIGN-FUNCALL ("stdcall_fun at 12" :CCONV :STDCALL) :INT 1 :INT 2 :INT 3 :INT))) (LOOP REPEAT 100 DO (FUN) FINALLY (RETURN (FUN))))
Expected value: 6
Actual value: #<SIMPLE-ERROR #x8CF40D6>.
 FUNCALL.NIL-SKIP DEFCFUN.CHAR DEFCFUN.DOCSTRING DEFCFUN.INT DEFCFUN.LONG
 DEFCFUN.LONG-LONG DEFCFUN.FLOAT DEFCFUN.DOUBLE DEFCFUN.STRING.1
 DEFCFUN.STRING.2 DEFCFUN.STRING.3 DEFCFUN.NOARGS
Test DEFCFUN.NOOP failed
Form: (NOOP)
Expected values:
Actual value: NIL.
 DEFCFUN.VARARGS.DOCSTRINGS DEFCFUN.VARARGS.CHAR DEFCFUN.VARARGS.SHORT
 DEFCFUN.VARARGS.INT DEFCFUN.VARARGS.LONG
Test DEFCFUN.VARARGS.FLOAT failed
Form: (WITH-FOREIGN-POINTER-AS-STRING (S 100) (SPRINTF S "%.2f" :FLOAT (FLOAT PI)))
Expected value: "3.14"
Actual value: "".
Test DEFCFUN.VARARGS.DOUBLE failed
Form: (WITH-FOREIGN-POINTER-AS-STRING (S 100) (SPRINTF S "%.2f" :DOUBLE (FLOAT PI 1.0D0)))
Expected value: "3.14"
Actual value: " N".
 DEFCFUN.VARARGS.STRING DEFCFUN.BFF.1 DEFCFUN.BFF.2 DEFCFUN.UNDEFINED
 DEFCFUN.DOUBLE26 DEFCFUN.FLOAT26
Test DEFCFUN.STDCALL.1 failed
Form: (LOOP REPEAT 100 DO (STDCALL-FUN 1 2 3) FINALLY (RETURN (STDCALL-FUN 1 2 3)))
Expected value: 6
Actual value: #<SIMPLE-ERROR #x8D25E96>.
 CALLBACKS.CHAR CALLBACKS.UNSIGNED-CHAR CALLBACKS.SHORT CALLBACKS.UNSIGNED-SHORT
 CALLBACKS.INT CALLBACKS.UNSIGNED-INT CALLBACKS.LONG CALLBACKS.UNSIGNED-LONG
 CALLBACKS.LONG-LONG CALLBACKS.UNSIGNED-LONG-LONG CALLBACKS.FLOAT
 CALLBACKS.DOUBLE CALLBACKS.POINTER CALLBACKS.STRING
 CALLBACKS.STRING-NOT-DOCSTRING%eax = 0xffffffff
%ecx = 0x00000000
%edx = 0x00a6fdd8
%ebx = 0x00a6ff3c
%esp = 0x00a6fd94
%ebp = 0x00a6fdb4
%esi = 0x00a6ff40
%edi = 0x00a6ff44
%eip = 0x00019c5d
%eflags = 0x00000217

%cs = 0x001b
%ds = 0x0023
%ss = 0x0023
%es = 0x0023
%fs = 0x003b
%gs = 0x0000
Exception on foreign stack

Exception occurred while executing foreign code
? for help
[3272] Clozure CL kernel debugger: B
current thread: tcr = 0x5cb330, native thread ID = 0xcd4, interrupts enabled


(#x00B80BF8) #x08BED385 : #<Function QSORT #x08BED25E> + 295
(#x00B80C10) #x08D39CD5 : #<Anonymous Function #x08D39AEE> + 487
(#x00B80C1C) #x08B9113D : #<Function (:INTERNAL %DO DO-ENTRY) #x08B90EBE> + 639
(#x00B80C2C) #x08B91835 : #<Function DO-ENTRY #x08B914A6> + 911
(#x00B80C6C) #x08B8D9A5 : #<Function DO-ENTRIES* #x08B8D826> + 383
(#x00B80C8C) #x08B9AC55 : #<Function RUN-CFFI-TESTS #x08B9AB6E> + 231
(#x00B80CC0) #x08B832A5 : #<Method-Function PERFORM (TEST-OP (#<3-element vector subtag = 72 @#x08B83756 (INSTANCE)>)) #x08B8327E> + 39
(#x00B80CD0) #x08CE01F5 : #<Anonymous Function #x08CE0186> + 111
(#x00B80CF4) #x089EFE4D : #<Function (:INTERNAL WITH-COMPILATION-UNIT-BODY OPERATE) #x089EFB06> + 839
(#x00B80D24) #x082FCF5D : #<Function CALL-WITH-COMPILATION-UNIT #x082FCEA6> + 183
(#x00B80D48) #x089F04DD : #<Function OPERATE #x089F025E> + 639
(#x00B80D8C) #x083686DD : #<Function CALL-CHECK-REGS #x083685E6> + 247
(#x00B80DA8) #x083744B5 : #<Function TOPLEVEL-EVAL #x083741C6> + 751
(#x00B80DE8) #x08375E25 : #<Function READ-LOOP #x0837570E> + 1815
(#x00B80EFC) #x0836832D : #<Function TOPLEVEL-LOOP #x083682E6> + 71
(#x00B80F04) #x08318175 : #<Function (:INTERNAL (TOPLEVEL-FUNCTION (LISP-DEVELOPMENT-SYSTEM T))) #x08318116> + 95
(#x00B80F14) #x083D945D : #<Function (:INTERNAL MAKE-MCL-LISTENER-PROCESS) #x083D9216> + 583
(#x00B80F60) #x08330A95 : #<Function RUN-PROCESS-INITIAL-FORM #x083307F6> + 671
(#x00B80FA4) #x083312E5 : #<Function (:INTERNAL %PROCESS-PRESET-INTERNAL) #x08331196> + 335
(#x00B80FCC) #x083061BD : #<Function (:INTERNAL THREAD-MAKE-STARTUP-FUNCTION) #x083060A6> + 279
[3272] Clozure CL kernel debugger:


More information about the cffi-devel mailing list