Hello,

We use openssl im our application servers and encounter the following
problem on SunOS Solaris 5.9 on SPARC:

the used call

        r = BIO_gets(slnpSSL[i].io, buf, maxlen);
        sslError = SSL_get_error(slnpSSL[i].ssl, r);
        switch (sslError) {
            case SSL_ERROR_NONE:
                len = r;
                break;
            default:
                fprintf(stderr, "SSL_get_error: %d\n", sslError);
                berr_exit("SSL read problem");
        }


will fail with SSL_ERROR_WANT_READ if the read(2) call on the socket is
interrupted by SIGALRM; a truss show this like this:

read(8, 0x0032842B, 5)          (sleeping...)
    Received signal #14, SIGALRM, in read() [caught]
      siginfo: SIG#0
read(8, 0x0032842B, 5)                          Err#4 EINTR
lwp_sigmask(SIG_SETMASK, 0x00000000, 0x00000000) = 0xFFBFFEFF
[0x0000FFFF]
time()                                          = 1396594526
sigaction(SIGALRM, 0xFFBF5AE0, 0xFFBF5B80)      = 0
alarm(60)                                       = 0
setcontext(0xFFBF5F68)
fstat64(2, 0xFFBF5CF8)                          = 0
write(2, " S S L   r e a d   p r o".., 17)      = 17
_exit(0)

i.e. the read(2) is not setup again by the system; 

on a Linux system it is; the same code and situation look like this:

19595 10:58:24.757535 alarm(60)         = 0
19595 10:58:24.757588 sigreturn()       = 3
19595 10:58:24.757638 read(7, 0x810469b, 5) = ? ERESTARTSYS (To be restarted)
19595 10:59:24.757784 --- SIGALRM (Alarm clock) @ 0 (0) ---
19595 10:59:24.757966 time(NULL)        = 1396601964
19595 10:59:24.758040 rt_sigaction(SIGALRM, {0x10000000080582b4, [], 0}, 
{0x10000000080582b4, [], 0}, 8) = 0
19595 10:59:24.758117 alarm(60)         = 0
19595 10:59:24.758172 sigreturn()       = 3
19595 10:59:24.758224 read(7, 0x810469b, 5) ...

Why is this different on Solaris and Linux?

        matthias


-- 
Matthias Apitz               |  /"\ ASCII Ribbon Campaign: www.asciiribbon.org
E-mail: g...@unixarea.de     |  \ / - No HTML/RTF in E-mail
WWW: http://www.unixarea.de/ |   X  - No proprietary attachments
phone: +49-170-4527211       |  / \ - Respect for open standards
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to