From: Matthias A. <mat...@gm...> - 2011-04-28 14:42:23
|
Am 28.04.2011 13:50, schrieb Thomas Jarosch: > On Thursday, 28. April 2011 13:18:59 Matthias Andree wrote: >> Looks like GMX. > > Yes, 1&1 ;) > >> what OS and version (distribution) does this happen on? Do the >> -debuginfo packages match the actual RPMs? Could you try building >> 6.3.19 from source and use that to somehow reproduce the hang? > > It's our custom distribution which is based on Fedora. > > I recovered the correct -debuginfo packages from the time I built the binary > RPMs. If the debuginfo packages don't fit (f.e. glibc header changed), > gdb will skip those debug symbols with an CRC mismatch error. > >> I wonder if the SSL stuff somehow masks the timeout alarm we're using, >> that could possibly explain things, but I don't have an idea how to >> figure that out yet. > > It just came to my mind: We can simulate the situation with socat. > And I was able to trigger the problem. Try this: > > - Start a "fake POP3 server" with socat: socat - tcp4-listen:110 > > - fetchmail connects to this server > > - Paste the welcome greeting: > +OK POP fake server ready H mimap4 > > - fetchmail will reply with: "CAPA" > > - Paste this: > +OK Capability list follows > TOP > USER > UIDL > STLS > SASL PLAIN > IMPLEMENTATION trinity > . > > - fetchmail will reply: "STLS" > > - Paste this: > +OK Begin TLS negotiation > > > Then do nothing in socat until the timeout should be triggered. Good idea. Timeouts work for me in 6.3.20-pre1, and I haven't changed the timeout handling since 6.3.18 AFAIR. The default is 300, I've changed it to 10 only for testing. Is there anything that masks or traps SIGALRM in your setup? I'm currently testing on Ubuntu 10.10 amd64 with OpenSSL 0.9.8o and libc6 which is embedded GNU libc 2.12.1 (both likely with Ubuntu patches). In one console: $ sudo socat -dddD - tcp4-listen:110,reuseaddr 1. paste +OK\n as greeting 2. paste +OK\nSTLS\n.\n as response to STLS, then wait In another console (I hope Thunderbird doesn't trash everything here): $ LC_ALL=C strace -T ./fetchmail -p pop3 -Nd0 localhost --nosyslog -s --timeout 10 socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 3 <0.000023> connect(3, {sa_family=AF_INET, sin_port=htons(110), sin_addr=inet_addr("127.0.0.1")}, 16) = 0 <0.000028> getsockname(3, {sa_family=AF_INET, sin_port=htons(38674), sin_addr=inet_addr("127.0.0.1")}, [16]) = 0 <0.000025> close(3) = 0 <0.000027> socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 3 <0.000026> connect(3, {sa_family=AF_INET, sin_port=htons(110), sin_addr=inet_addr("127.0.0.1")}, 16) = 0 <0.000101> setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={10, 0}}, NULL) = 0 <0.000016> setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={0, 0}}, NULL) = 0 <0.000013> setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={10, 0}}, NULL) = 0 <0.000014> recvfrom(3, "+OK\n", 512, MSG_PEEK, NULL, NULL) = 4 <3.263103> read(3, "+OK\n", 4) = 4 <0.000031> setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={0, 0}}, NULL) = 0 <0.000021> setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={10, 0}}, NULL) = 0 <0.000020> write(3, "CAPA\r\n", 6) = 6 <0.000090> setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={10, 0}}, NULL) = 0 <0.000020> recvfrom(3, "+OK\n", 512, MSG_PEEK, NULL, NULL) = 4 <1.739998> read(3, "+OK\n", 4) = 4 <0.000030> setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={0, 0}}, NULL) = 0 <0.000020> setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={10, 0}}, NULL) = 0 <0.000020> recvfrom(3, "STLS\n", 63, MSG_PEEK, NULL, NULL) = 5 <0.959806> read(3, "STLS\n", 5) = 5 <0.000026> setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={0, 0}}, NULL) = 0 <0.000019> setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={10, 0}}, NULL) = 0 <0.000020> recvfrom(3, ".\n", 63, MSG_PEEK, NULL, NULL) = 2 <0.220514> read(3, ".\n", 2) = 2 <0.000030> setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={0, 0}}, NULL) = 0 <0.000021> write(3, "STLS\r\n", 6) = 6 <0.000078> setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={10, 0}}, NULL) = 0 <0.000031> recvfrom(3, 0x7fff216f2770, 512, 2, 0, 0) = ? ERESTARTSYS (To be restarted) <9.999914> --- SIGALRM (Alarm clock) @ 0 (0) --- rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 <0.000023> rt_sigprocmask(SIG_UNBLOCK, ~[RTMIN RT_1], NULL, 8) = 0 <0.000020> fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 1), ...}) = 0 <0.000021> mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff3a6332000 <0.000024> write(1, "fetchmail: timeout after 10 seco"..., 66fetchmail: timeout after 10 seconds waiting for server localhost. ) = 66 <0.000031> rt_sigaction(SIGALRM, {0x40dce0, [], SA_RESTORER, 0x7ff3a4a75c20}, {0x40e0e0, [], SA_RESTORER, 0x7ff3a4a75c20}, 8) = 0 <0.000019> setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={60, 0}}, NULL) = 0 <0.000020> close(3) = 0 <0.000097> setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={0, 0}}, NULL) = 0 <0.000029> rt_sigaction(SIGALRM, {0x40e0e0, [], SA_RESTORER, 0x7ff3a4a75c20}, {0x40dce0, [], SA_RESTORER, 0x7ff3a4a75c20}, 8) = 0 <0.000019> write(2, "fetchmail: ", 11fetchmail: ) = 11 <0.000024> write(2, "socket error while fetching from"..., 51socket error while fetching from mandree@localhost ) = 51 <0.000023> setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={0, 0}}, NULL) = 0 <0.000019> rt_sigaction(SIGALRM, {0x4074f0, [], SA_RESTORER, 0x7ff3a4a75c20}, {0x40e0e0, [], SA_RESTORER, 0x7ff3a4a75c20}, 8) = 0 <0.000018> write(1, "fetchmail: Query status=2 (SOCKE"..., 35fetchmail: Query status=2 (SOCKET) ) = 35 <0.000023> |