From: Voldemar <de...@it...> - 2006-03-21 14:34:47
|
Fetchmail crash (SIGSERV) Hello ! $ uname -a FreeBSD netadmin.ssmu.ru 4.11-RELEASE FreeBSD 4.11-RELEASE #3: Wed Aug 17 10:31: 07 OMSST 2005 ro...@ne...:/usr/src/sys/compile/netadmin i386 fetchmail-6.3.2_1 Build from FreeBSD-ports (from source) $ gcc -v Using builtin specs. gcc version 2.95.4 20020320 [FreeBSD] $ fetchmail -V This is fetchmail release 6.3.2+POP2+RPA+SDPS+SSL+OPIE+NLS. $ cat .fetchmailrc poll inet.tsu.ru timeout 120 protocol pop3 user deka pass **** poll pop3.mail.ru timeout 180 protocol pop3 user vega0 pass **** poll 212.192.112.206 timeout 30 protocol pop3 user deka pass **** $ fetchmail fetchmail: No mail for deka at inet.tsu.ru POP3 connection to pop3.mail.ru failed: Connection refused fetchmail: Query status=2 (SOCKET) Segmentation fault $ gdb fetchmail ...[skip]... Program received signal SIGSEGV, Segmentation fault. 0x8061c20 in xstrdup (s=0x0) at xmalloc.c:56 56 p = (char *) xmalloc(strlen(s)+1); (gdb) backtrace #0 0x8061c20 in xstrdup (s=0x0) at xmalloc.c:56 #1 0x805478d in do_session (ctl=0x8081600, proto=0x80642c0, maxfetch=0) at driver.c:1030 #2 0x8055573 in do_protocol (ctl=0x8081600, proto=0x80642c0) at driver.c:1630 #3 0x804bf6e in doPOP3 (ctl=0x8081600) at pop3.c:1304 #4 0x80501cd in query_host (ctl=0x8081600) at fetchmail.c:1403 #5 0x804eac4 in main (argc=1, argv=0xbfbffb10) at fetchmail.c:685 It seems to me, the function getaddrinfo returns 0 (no error), but thus res->ai_canonname == 0, that leads SIGSERV at attempt strcpy(0) in xmalloc.c:xstrdup. I do not know, whether is a mistake: fetchmail or incorrect behaviour libc. My variant of patch (not assured of its correctness, however fetchmail starts to work normally): $ diff driver.c ../driver.c 1030c1030,1034 < ctl->server.truename = xstrdup(res->ai_canonname); --- > if (res->ai_canonname) { > ctl->server.truename = xstrdup(res->ai_canonname); > } else { > ctl->server.truename = xstrdup(ctl->server.queryname); > }; Excuse me, if to you already informed on this mistake. Thanks |