Bodo Moeller via RT wrote:

>Ralph via RT <[EMAIL PROTECTED]>:
>
>  
>
>>But so far, I can tell you that when SSL_get_error() returns 
>>SSL_ERROR_SYSCALL and you inspect errno, it tells EWOULDBLOCK or EAGAIN. 
>>By  repeating the SSL_* call as long as this condition occurs, I can 
>>overcome the problem and the SSL handshake and communication works 
>>perfectly. Oh...it's in a multi-threaded application, too! Maybe this 
>>helps (OpenSSL compiled with the correct switch for MT - I hope)
>>    
>>
>
>If OpenSSL is *not* compiler with correct switches for multithreading,
>that would explain -- in that case, SSL_get_error() could be reading
>the wrong copy of errno and thus not find the EWOULDBLOCK/EAGAIN code.
>
>Here's something to try: find the 'errno' definition for multi-threading
>in the system header files, which should involve some function call;
>then use 'nm' to see if that function is mentioned in the OpenSSL
>object files that you are linking with. (bss_sock.o is the object
>file to look at.)
>
Hi Bodo,

sorry that it took so long, but I had too much work ;-)

However, I tracked the problem down. You were right  in saying that 
OpenSSL libraries were not compiled and linked correctly to the threads 
libraries of AIX. But with the out-of-the box  configuration tool 
(configure) it is nearly impossible to do that on AIX systems. The 
correct compiler to be used is xlc_r which ist the only by IBM supported 
AIX compiler . I just changed the Makefile definition after configuring:

CC=/usr/vac/bin/xlc_r

(this is the standard location of the compiler) and the libraries had 
the correct functions for errno linked (checked it against the 
application and the SSL_ERROR_SYSCALL vanished).

So my question would be as followed: In configure script,

- either check for "threads" option and existence of xlc_r  and use it. Or,
- (this is my favourite and been used by Apache configure scripts)
  evaluate an environment  variable named CC and use this as the compiler
  to use, regardless what the configure script would evaluate

As I told you, this is an AIX specific problem with threading but may 
occur on other systems as well. So applying the CC variable option is 
the best approach to deal with it (in my opinion).

Thanx anyway for your help,

Ralph


P.S.: If you need evaluations on AIX, feel free to contact me as I got 
access to them.


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to