On December 5, 2012 2:07:14 AM PST, Ben Morrow <[email protected]> wrote:
> At 1AM -0800 on 5/12/12 Erik A Johnson wrote:
>> FYI, the tcpdump I sent previously was with one of our
>> previously-discussed patches in place:
>>
>> if (!proxy->client_proxy && net_geterror(proxy->fd_ssl) == EBADF) {
>>
>> I'm attaching that dump again (as
>> tcpdump_output_witholdpatch_headeronly.txt), as well as a dump without
>> any of the patches (tcpdump_output_withoutpatches_headeronly.txt) in
>> case there is any difference.
>
> Well, they're certainly different. Are you sure the second trace
> (withoutpatches) was of a session which went into an infinite loop?
> The only thing peculiar about that trace is that the server closes the
> connection after receiving the first packet from the client, but it does
> so perfectly properly: it ACKs the client's data packet, and does the
> FIN-FIN/ACK exchance properly. You will notice there are no [R] packets,
> which indicate something odd is happening at the server end.
I'm pretty sure, but I've run it again, confirmed that the imap-login process
is using 100% of a CPU until I kill it, and have attached the tcpdump. Looks
like one packet from SERVER to CLIENT shifted slightly in chronology, but
otherwise the same.
>>> #ifdef SO_ISDEFUNCT
>>> + if (getsockopt(proxy->fd_ssl, SOL_SOCKET, SO_ISDEFUNCT,
>>> + (void *)&err, sizeof(err)) == 0 && err) {
>>> + errstr = t_strdup_printf(
>>> + "%s: socket is defunct", func_name);
>>> + break;
>>> + }
>>> +#endif
>>
>> Nope, SO_ISDEFUNCT isn't defined.
>
> Oh, sorry, that needs
>
> #include <sys/socket.h>
>
> at the top. If that doesn't work, then which version of the OS are you
> building for? AFAICT the DEFUNCT socket flag has been present since at
> least 10.5, but the SO_ISDEFUNCT option was only introduced in 10.7.
> This is irritating, actually: it means that to properly fix this on all
> versions of Mac OS Dovecot would need to include the previous ENOTCONN
> code #ifndef SO_ISDEFUNCT.
I've got both 10.7 and 10.8 SDKs in Xcode and neither have SO_ISDEFUNCT defined
in sys/socket.h (or anywhere else in the usr/include directories) -- there's a
SS_DEFUNCT mask defined in sys/socketvar.h -- is that what you're looking for?
19:53:08.815125 IP (tos 0x0, ttl 64, id 4372, offset 0, flags [DF], proto TCP
(6), length 64)
CLIENT.56600 > SERVER.imaps: Flags [S], cksum 0xcfec (correct), seq
2307706944, win 65535, options [mss 1460,nop,wscale 3,nop,nop,TS val 1053939266
ecr 0,sackOK,eol], length 0
19:53:08.815320 IP (tos 0x0, ttl 64, id 33269, offset 0, flags [DF], proto TCP
(6), length 64)
SERVER.imaps > CLIENT.56600: Flags [S.], cksum 0x62a3 (correct), seq
770432701, ack 2307706945, win 65535, options [mss 1460,nop,wscale 4,nop,nop,TS
val 955787158 ecr 1053939266,sackOK,eol], length 0
19:53:08.819981 IP (tos 0x0, ttl 64, id 35391, offset 0, flags [DF], proto TCP
(6), length 52)
CLIENT.56600 > SERVER.imaps: Flags [.], cksum 0xa26f (correct), seq 1, ack
1, win 65535, options [nop,nop,TS val 1053939268 ecr 955787158], length 0
19:53:08.820087 IP (tos 0x0, ttl 64, id 26483, offset 0, flags [DF], proto TCP
(6), length 182)
CLIENT.56600 > SERVER.imaps: Flags [P.], cksum 0x198f (correct), seq 1:131,
ack 1, win 65535, options [nop,nop,TS val 1053939268 ecr 955787158], length 130
19:53:08.820168 IP (tos 0x0, ttl 64, id 45510, offset 0, flags [DF], proto TCP
(6), length 52)
SERVER.imaps > CLIENT.56600: Flags [.], cksum 0x8240 (correct), seq 1, ack
1, win 8235, options [nop,nop,TS val 955787162 ecr 1053939268], length 0
19:53:08.820170 IP (tos 0x0, ttl 64, id 30081, offset 0, flags [DF], proto TCP
(6), length 52)
SERVER.imaps > CLIENT.56600: Flags [.], cksum 0x81be (correct), seq 1, ack
131, win 8235, options [nop,nop,TS val 955787162 ecr 1053939268], length 0
19:53:08.825990 IP (tos 0x0, ttl 64, id 14252, offset 0, flags [DF], proto TCP
(6), length 52)
SERVER.imaps > CLIENT.56600: Flags [F.], cksum 0x81b8 (correct), seq 1, ack
131, win 8235, options [nop,nop,TS val 955787167 ecr 1053939268], length 0
19:53:08.829863 IP (tos 0x0, ttl 64, id 23663, offset 0, flags [DF], proto TCP
(6), length 52)
CLIENT.56600 > SERVER.imaps: Flags [.], cksum 0xa1e3 (correct), seq 131,
ack 2, win 65535, options [nop,nop,TS val 1053939268 ecr 955787167], length 0
19:53:08.829911 IP (tos 0x0, ttl 64, id 8663, offset 0, flags [DF], proto TCP
(6), length 52)
SERVER.imaps > CLIENT.56600: Flags [.], cksum 0x81b5 (correct), seq 2, ack
131, win 8235, options [nop,nop,TS val 955787170 ecr 1053939268], length 0
19:53:08.830107 IP (tos 0x0, ttl 64, id 46369, offset 0, flags [DF], proto TCP
(6), length 52)
CLIENT.56600 > SERVER.imaps: Flags [F.], cksum 0xa1e2 (correct), seq 131,
ack 2, win 65535, options [nop,nop,TS val 1053939268 ecr 955787167], length 0
19:53:08.830143 IP (tos 0x0, ttl 64, id 51866, offset 0, flags [DF], proto TCP
(6), length 52)
SERVER.imaps > CLIENT.56600: Flags [.], cksum 0x81b4 (correct), seq 2, ack
132, win 8235, options [nop,nop,TS val 955787170 ecr 1053939268], length 0