From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20940 invoked by alias); 23 Jun 2014 16:16:05 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 20922 invoked by uid 89); 23 Jun 2014 16:16:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: limerock01.mail.cornell.edu Received: from limerock01.mail.cornell.edu (HELO limerock01.mail.cornell.edu) (128.84.13.241) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 23 Jun 2014 16:16:00 +0000 X-CornellRouted: This message has been Routed already. Received: from authusersmtp.mail.cornell.edu (granite4.serverfarm.cornell.edu [10.16.197.9]) by limerock01.mail.cornell.edu (8.14.4/8.14.4_cu) with ESMTP id s5NGFwec019214 for ; Mon, 23 Jun 2014 12:15:58 -0400 Received: from [192.168.1.6] (cpe-67-249-194-47.twcny.res.rr.com [67.249.194.47]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id s5NGFv4C025459 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT) for ; Mon, 23 Jun 2014 12:15:57 -0400 Message-ID: <53A852B6.4050702@cornell.edu> Date: Mon, 23 Jun 2014 16:16:00 -0000 From: Ken Brown User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: cygwin@cygwin.com Subject: Re: getaddrinfo : Non-recoverable failure in name resolution References: <53A81259.4080300@gmail.com> <20140623122510.GD1803@calimero.vinschen.de> <53A82688.9010005@gmail.com> In-Reply-To: <53A82688.9010005@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2014-06/txt/msg00362.txt.bz2 On 6/23/2014 9:07 AM, Marco Atzeri wrote: > > On 23/06/2014 14:25, Corinna Vinschen wrote: >> Hi Marco, >> >> On Jun 23 13:41, Marco Atzeri wrote: > >>> >>> 64 $ ./getaddrinfo_test-2_64 >>> getaddrinfo: Non-recoverable failure in name resolution >>> >>> >>> Am I missing something ? >>> The second way is currently used on postgresql in several places, >>> but it seems to fail only for "127.0.0.1" >> >> I don't know why this only fails for "127.0.0.1". But this is clearly a >> problem in the 64 bit Cygwin DLL. >> >> What happens is that the field ai_addrlen is defined as socklen_t in >> POSIX, but as size_t in the W32 API. On 64 bit, socklen_t is 4 bytes >> while size_t is 8 bytes. Setting all the hintp members manually (in >> contrast to calloc'ing it or memset'ing it to 0) leaves the 4 upper >> bytes of the ai_addrlen untouched. This in turn leads to a high >> probability that ai_addrlen has an invalid value when entering Winsock's >> getsockopt. >> >> I'm really surprised this hasn't been hit before. I'm going to fix that >> in Cygwin by setting the upper 4 bytes of ai_addrlen to 0 explicitely. > > Probably we have seen already but not identified. I wonder if this could explain the mysterious emacs crashes that have been reported on 64-bit Cygwin. The emacs code does set the hintp members manually in some places. The crashes seem to occur randomly, and the backtraces often don't make sense. Ken -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple