[cffi-devel] CCL on Windows errors
Anton Vodonosov
avodonosov at yandex.ru
Sat Apr 9 15:44:07 UTC 2011
Hello.
I have a crash when use CFFI + CCL + callbacks on Windows.
I am not sure the crash is caused by CFFI, there is another suspect. But the CFFI tests on Windows have errors.
Could you take a look to the test results (attached)? This is CFFI 0.10.6
About the crash. It happens with CL+SSL.
OpenSSL requires multi-threaded applications to provide a callback, which implements locking,
as described here: http://www.openssl.org/docs/crypto/threads.html.
The callback function prototype is
void locking_function(int mode, int n, const char *file, int line)
The callback is installed using
void CRYPTO_set_locking_callback(void (*func)(int mode,int type,
const char *file,int line))
CL+SSL has the following definitions:
(cffi:defcallback locking-callback :void
((mode :int)
(n :int)
(file :string)
(line :int))
;(declare (ignore file line))
;; the callback body here
)
(cffi:defcfun ("CRYPTO_set_locking_callback" crypto-set-locking-callback)
:void
(fun :pointer))
If during initialization of CL+SSL we do
(crypto-set-locking-callback (cffi:callback locking-callback))
then we have a crash at the first SSL connection to hunchentoot. The crash is 100% reproducible.
It doesn't matter what we have in the callback body, it may be even empty. The symptoms are
always the same.
If we comment out the line
;; (crypto-set-locking-callback (cffi:callback locking-callback))
then the crash doesn't happen.
As I said, I am not sure CFFI is the cause of the crash. I tried to print the values
passed to the callback, they are not corrupted, valid numbers and strings.
Also, the callback is called thousands of times before the crash happen.
But on the other hand, if we don't set the callback, the crash doesn't happen;
and setting even empty callback guarantees the crash...
Anyway, If you provide any patches to CFFI, at least to fix the tests, I can
run the tests on Windows.
Best regards,
- Anton
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cffi-test-results-ccl-1-6-windows.txt
URL: <https://mailman.common-lisp.net/pipermail/cffi-devel/attachments/20110409/5c6b04c9/attachment.txt>
More information about the cffi-devel
mailing list