[cl-plus-ssl-devel] Possible bug in test-https-server (2008-11-04)

John McAleely john at mcaleely.com
Wed Jan 21 12:27:47 UTC 2009


Folks,

I've done some digging, but my domain knowledge is minimal, so  
progress is slow.

The error I reported yesterday:

(ssl-test::run-all-tests)
<snip>
> SSL server ldx86cl64(400,0xb029c000) malloc: *** error for object
> 0x10df20: double free

<snip>

Appears to be because the two threads in the test make calls to cl 
+ssl:make-ssl-server-stream and cl+ssl:make-ssl-client-stream  
simultaneously, and the defences against double-initialisation in cl 
+ssl:ensure-initialised are ineffective in this case (is there a lock  
missing, or not working, in my setup?)

Anyway, as a 'hack', I simply inserted a call to cl+ssl:ensure- 
initialised before the two threads spawn:

(deftest echo
   (cl+ssl:ensure-initialized) ; hack!
   (with-thread ("simple server" #'init-server #'test-server)
     (with-open-stream (socket (init-client))

This allows the tests to execute, and now 5/8 pass. However, all of  
those with 'unwrap strategy nil' fail.

In the log below, I added a line to ssl-signal-error so that I could  
find out what call cl+ssl thought it was making, which ssl thinks is  
not appropriate:

(defun ssl-signal-error (handle syscall error-code original-error)
   (format t "Error during SSLcall: ~a~%" syscall)

Given the circumstance, my theory is that the 'wrong' handle is passed  
by the lisp code to the ssl-write function? However, I have no clue at  
the moment what that might be caused by.

Any suggestions?

J

(ps, I assume the log of an 'error' on SSL-read in a passing test is  
correct behaviour)

? (ssl-test::run-all-tests)

----- ECHO ----------------------------
SSL server listening on port 8080
SSL server accepting...
Responding to query test...
Responding to query test2...
Responding to query test3...
Error during SSLcall: #<Compiled-function SSL-READ #x30004116201F>
===== [OK] ECHO ====================

----- UNWRAP-STRATEGY-NIL ----------------------------
SSL server listening on port 8080
SSL server accepting...
Error during SSLcall: #<Compiled-function SSL-WRITE #x30004116274F>
Error during SSLcall: #<Compiled-function SSL-READ #x30004116201F>
aborting test thread echo server for strategy test: A failure in the  
SSL library occurred on handle #<A Foreign Pointer #x11CC30>. (Return  
code: 1)SSL error queue:
error:140C5042:SSL routines:SSL_UNDEFINED_FUNCTION:called a function  
you should not call

===== [FAIL] UNWRAP-STRATEGY-NIL: A failure in the SSL library  
occurred on handle #<A Foreign Pointer #x11C820>. (Return code: 1)SSL  
error queue:
error:140C5042:SSL routines:SSL_UNDEFINED_FUNCTION:called a function  
you should not call

muffling follow-up error failed to close sockets properly:  #<BASIC- 
TCP-STREAM :CLOSED #x30004127506D>
   #<BASIC-TCP-STREAM :CLOSED #x3000412BF6BD>


----- UNWRAP-STRATEGY-T ----------------------------
SSL server listening on port 8080
SSL server accepting...
Responding to query test...
Error during SSLcall: #<Compiled-function SSL-READ #x30004116201F>
===== [OK] UNWRAP-STRATEGY-T ====================

<snip - more tests. all with unwrap-strategy-nil fail similarly >





More information about the cl-plus-ssl-devel mailing list