From deka@itc.tsu.ru Mon Mar 27 08:59:53 2006 Return-Path: Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 343C516A400 for ; Mon, 27 Mar 2006 08:59:53 +0000 (UTC) (envelope-from deka@itc.tsu.ru) Received: from itc.tsu.ru (itc.tsu.ru [212.192.100.158]) by mx1.FreeBSD.org (Postfix) with ESMTP id 33BEA43D45 for ; Mon, 27 Mar 2006 08:59:51 +0000 (GMT) (envelope-from deka@itc.tsu.ru) Received: from itc.tsu.ru (localhost [127.0.0.1]) by itc.tsu.ru (8.13.1/8.13.1) with ESMTP id k2R95tmA050372 for ; Mon, 27 Mar 2006 16:05:55 +0700 (OMSST) (envelope-from deka@itc.tsu.ru) Received: (from deka@localhost) by itc.tsu.ru (8.13.1/8.13.1/Submit) id k2R95n0i050371; Mon, 27 Mar 2006 16:05:49 +0700 (OMSST) (envelope-from deka) Message-Id: <200603270905.k2R95n0i050371@itc.tsu.ru> Date: Mon, 27 Mar 2006 16:05:49 +0700 (OMSST) From: Vladimir Olegovich Reply-To: Vladimir Olegovich To: FreeBSD-gnats-submit@freebsd.org Cc: Subject: incorrect behaviour libc.getaddrinfo() X-Send-Pr-Version: 3.113 X-GNATS-Notify: >Number: 94995 >Category: standards >Synopsis: incorrect behaviour libc.getaddrinfo() >Confidential: no >Severity: serious >Priority: low >Responsible: freebsd-standards >State: closed >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Mar 27 09:00:30 GMT 2006 >Closed-Date: Mon Mar 27 16:48:49 GMT 2006 >Last-Modified: Mon Mar 27 16:48:49 GMT 2006 >Originator: Vladimir Olegovich >Release: FreeBSD 4.11-RELEASE i386 >Organization: >Environment: 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. System: FreeBSD netadmin.ssmu.ru 4.11-RELEASE FreeBSD 4.11-RELEASE #3: Wed Aug 17 10:31:07 OMSST 2005 root@netadmin.ssmu.ru:/usr/src/sys/compile/netadmin i386 >Description: The function getaddrinfo returns 0 (no error), but thus res->ai_canonname == 0, that contradicts IEEE Std 1003.1-2001, which requests that the implementation copies the nodename if no canonical name is available. FreeBSD 4.11's implementation however does not do that. Possibly, failure has occured, when getaddrinfo has received the digital nodename ("212.192.112.206"), instead of string. >How-To-Repeat: I have found this situation: $ 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 My config file: $ 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 **** Possibly, failure has occured, when getaddrinfo has received the digital nodename ("212.192.112.206"), instead of string. >Fix: >Release-Note: >Audit-Trail: State-Changed-From-To: open->closed State-Changed-By: ume State-Changed-When: Mon Mar 27 16:47:45 UTC 2006 State-Changed-Why: I've just MFC'ed it into RELENG_4. Thanks for your report. http://www.freebsd.org/cgi/query-pr.cgi?pr=94995 >Unformatted: