X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:reply-to :references:mime-version:content-type:in-reply-to; q=dns; s= default; b=oeAuNskeKR5RcYOjp6TVKpaTpDn7vNKlnEI8hmwx75bxidr935kLT ABIesXG/B+nCQ0x8tPjC3HIKVtJqFhILp28A3zqIMmcN9LXhvA4X3jpmIYado/zL CB9VPRmBNb9LQuy4Tzxj1h7NWYfAGrucngqNLCBSniJPrcrqHigpBw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:reply-to :references:mime-version:content-type:in-reply-to; s=default; bh=tHsTCRenwCk0aSLSGwrNPXeYDuw=; b=g10UgddnbS+VNYXOfVxdshSsqTHR rvLEqcp38I6ANFiWpkDo4EJ+NKEzN7hmklyFRJgXDDynYU7kkb75GLNYqEZREetR cFAv0Fuyt3KqrJqqff8FW8ZZKYMyB6gpJH7N3LlR9dogzJdj+l8JmcVIJ5N8vSPN oFqmGCzksk1sZVQ= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: calimero.vinschen.de Date: Mon, 23 Jun 2014 15:44:11 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: getaddrinfo : Non-recoverable failure in name resolution Message-ID: <20140623134411.GF1803@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <53A81259 DOT 4080300 AT gmail DOT com> <20140623122510 DOT GD1803 AT calimero DOT vinschen DOT de> <53A82688 DOT 9010005 AT gmail DOT com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="V4b9U9vrdWczvw78" Content-Disposition: inline In-Reply-To: <53A82688.9010005@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) --V4b9U9vrdWczvw78 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Jun 23 15:07, Marco Atzeri wrote: >=20 > On 23/06/2014 14:25, Corinna Vinschen wrote: > >Hi Marco, > > > >On Jun 23 13:41, Marco Atzeri wrote: >=20 > >> > >>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. >=20 > Probably we have seen already but not identified. >=20 > >For the time being, you might prepend > > > > memset (&hintp, 0, sizeof hintp); > > > >to the code, prior to setting the elements manually. >=20 > I will wait next snapshot. Generated. Thanks, Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --V4b9U9vrdWczvw78 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJTqC8rAAoJEPU2Bp2uRE+gIskP/27PfJVjwgYPJgHLxEOP/NqJ mZCqYRSrQqrehGUfckw13PMocPKvA0ZHfaPMV+HZCJA8S95up1B8LTzHrBB3o+Oc D1+FkxwCbT1iyHGIGfvkoSyRWQ7KP3LXhTMU7+0iQFM7JYDKqph6uVRQYmYxbT8E qZCTSskrTU7mNY1PFXlaa3uwPefMt3nyCcWDTO/HVVHI75gfpIRp3jktOBXx+zqD VHMXu+/9XFTaypC8acNbHcnKqti3+4OKr4eNs05GqFj/DAL9OjGz/BenabF4hcCc XsIOdB1ZnD7DQN02uqzob/qbfkqz7CkwwPljD2rh0TbDG/47NWEKDEEZXrROFj+K JZFBFzIlFU2eEPh9Jt/LmIE1WIRkt6ZRqtD3RPxmN12c2pVshqLCzaLBvJP9OoTX QqrJsVbTjIO8l5i5PrjUxF7bBxZnEOlX0wqIYSKpDbfWMpLmtzI3A/KTX3K0+TU8 +mribaAYCP89MsWcj7dxa+/wa+HVSJcybnBMxKpclMUaPQNQhNUnQYQBEPmYf1xr 7MiGytLtwAN+bnYkk0ODMXqXtYqWSBCJyaXZDDMvQ0YV/Bvh6Ao0Qvu/UtNcOqFv /J/4rNkQqGKnaoMfxIaFHrMI8PB1dUITcZmF5UhV8CfLZBZzr8+w42TSrzov93EW ZYhESASondh/n6ZGIj+6 =pLP6 -----END PGP SIGNATURE----- --V4b9U9vrdWczvw78--