From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1268 invoked by alias); 23 Jun 2014 13:44:15 -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 1256 invoked by uid 89); 23 Jun 2014 13:44:14 -0000 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 Received: from aquarius.hirmke.de (HELO calimero.vinschen.de) (217.91.18.234) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 23 Jun 2014 13:44:13 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id 2E8828E0C66; Mon, 23 Jun 2014 15:44:11 +0200 (CEST) Date: Mon, 23 Jun 2014 13:44:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: getaddrinfo : Non-recoverable failure in name resolution Message-ID: <20140623134411.GF1803@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <53A81259.4080300@gmail.com> <20140623122510.GD1803@calimero.vinschen.de> <53A82688.9010005@gmail.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) X-SW-Source: 2014-06/txt/msg00357.txt.bz2 --V4b9U9vrdWczvw78 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1544 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 Content-length: 819 -----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--