Bug 209603 - Frequent disconnection from SSL server.
Frequent disconnection from SSL server.
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: xchat (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Christopher Aillon
: EasyFix, Patch
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-10-06 07:53 EDT by David Woodhouse
Modified: 2007-11-30 17:11 EST (History)
3 users (show)

See Also:
Fixed In Version: 2.6.8
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-07-19 06:58:07 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patch to do what Tomas said. (692 bytes, patch)
2006-10-07 05:28 EDT, David Woodhouse
no flags Details | Diff

  None (edit)
Description David Woodhouse 2006-10-06 07:53:40 EDT
When I start xchat it keeps saying this to stderr

SSL_read/read: Resource temporarily unavailable.

And the link to the server gets closed. In the channel tabs, xchat says:
 -- Disconnected (Illegal seek)
Comment 1 David Woodhouse 2006-10-06 08:00:28 EDT
This is probably an openssl bug.
Comment 2 David Woodhouse 2006-10-06 08:01:22 EDT
poll([{fd=3, events=POLLIN}, {fd=5, events=POLLIN}, {fd=24, events=POLLIN|POLLPR
I}, {fd=20, events=POLLIN|POLLPRI}, {fd=10, events=POLLIN|POLLPRI}, {fd=9, event
s=POLLIN|POLLPRI}, {fd=8, events=POLLIN|POLLPRI}, {fd=11, events=POLLIN|POLLPRI,
 revents=POLLIN}], 8, 145) = 1
read(11, "\27\3\0\0 ", 5)               = 5
read(11, "\30\1\271\n\204\'.\227\372\226g\177\335\267\261\235\17"..., 32) = 32
read(11, "\27\3\0\0000", 5)             = 5
read(11, "\304X\335C_\261\24\204b\304T\6\25\303\300\177D\346\232"..., 48) = 48
time(NULL)                              = 1160135921
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=1323, ...}) = 0
time(NULL)                              = 1160135921
read(11, 0x103a0a20, 5)                 = -1 EAGAIN (Resource temporarily unavai
lable)
dup(2)                                  = 4
fcntl64(4, F_GETFL)                     = 0x2 (flags O_RDWR)
fstat64(4, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 2), ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x338
fd000
_llseek(4, 0, 0x7fadf808, SEEK_CUR)     = -1 ESPIPE (Illegal seek)
write(4, "SSL_read/read: Resource temporar"..., 48) = 48
close(4)                                = 0
Comment 3 Tomas Mraz 2006-10-06 08:37:13 EDT
I don't believe it much. I'd rather suppose that xchat doesn't call openssl
correctly or something like that.

Could you try to reproduce this problem with various openssl and xchat version
combinations?
Comment 4 David Woodhouse 2006-10-06 08:43:03 EDT
I'm rebuilding both with debug info now, and I'll work out precisely what's
going on. It looks like we're hitting the SSL_ERROR_SYSCALL case here in xchat's
common/ssl.c:

int
_SSL_recv (SSL * ssl, char *buf, int len)
{
        int num;


        num = SSL_read (ssl, buf, len);

        switch (SSL_get_error (ssl, num))
        {
        case SSL_ERROR_SSL:
                /* ??? */
                __SSL_fill_err_buf ("SSL_read");
                fprintf (stderr, "%s\n", err_buf);
                break;
        case SSL_ERROR_SYSCALL:
                /* ??? */
                perror ("SSL_read/read");
                break;


Comment 5 Tomas Mraz 2006-10-06 08:50:41 EDT
My theory (I didn't study the xchat code) is that it sets the SSL socket to
nonblocking I/O and then it doesn't properly handle the situation where EAGAIN
is returned -> should simply go back to poll() and wait for more data. But I
might be wrong.
Comment 6 David Woodhouse 2006-10-06 09:06:08 EDT
Joy. With my own builds of openssl and xchat it doesn't happen any more. Yet I
definitely saw it with pristine rawhide on both i386 and PowerPC.

Will revert to official packages and download the matching debuginfo.
Comment 7 David Woodhouse 2006-10-07 05:28:51 EDT
Created attachment 137968 [details]
Patch to do what Tomas said.

Looks like Tomas was right, and this fixes it.

Thanks.
Comment 8 David Woodhouse 2007-03-06 09:13:27 EST
This is still happening in FC6.
Comment 9 Kevin Kofler 2007-07-19 06:58:07 EDT
This exact patch has been applied upstream in 2.6.8, so the 2.8.4 builds in F7 
updates and Rawhides already have the fix.

Note You need to log in before you can comment on or make changes to this bug.