This is the mail archive of the
mailing list for the Cygwin project.
Re: getaddrinfo : Non-recoverable failure in name resolution
- From: Ken Brown <kbrown at cornell dot edu>
- To: cygwin at cygwin dot com
- Date: Mon, 23 Jun 2014 12:15:50 -0400
- Subject: Re: getaddrinfo : Non-recoverable failure in name resolution
- Authentication-results: sourceware.org; auth=none
- References: <53A81259 dot 4080300 at gmail dot com> <20140623122510 dot GD1803 at calimero dot vinschen dot de> <53A82688 dot 9010005 at gmail dot com>
On 6/23/2014 9:07 AM, Marco Atzeri wrote:
On 23/06/2014 14:25, Corinna Vinschen wrote:
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
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
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple