delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2014/06/23/12:16:23

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:message-id:date:from:mime-version:to:subject
:references:in-reply-to:content-type:content-transfer-encoding;
q=dns; s=default; b=eOe+osjQ08bd3TT9odt5DA09EGugdFbtlDV5V9serdW
U9yBynN89kcHFtRbslExCKFsQCAVz0p1SvCsB8z8pgt5v1+nHAYZ5DKVh5BSIgBZ
Cfq1g69Sq2ShHhT4RkwQvYcUdJ8mOEPolkpMB+FrG+nYLTALC2BKLAi3LbMth+60
=
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:message-id:date:from:mime-version:to:subject
:references:in-reply-to:content-type:content-transfer-encoding;
s=default; bh=VRg5/ZZXzkHCK1GSRsvpnekV/eU=; b=OTOpEX6nh6K7nBgHB
vW6R3wUXh1TF6NCPfzMSMa0GXUO+cViFy8yz58rt8+A0ZlWd1KE9MleGlNeXE5PO
6wqqfekbMLo89RTQoBs8r97UGQ6lBALqngE7JalDbaoMAt/LNAY/6ZRZSxxP0fxq
1A02JpvlMcXylAtAmwufoUVQnU=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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=-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
X-CornellRouted: This message has been Routed already.
Message-ID: <53A852B6.4050702@cornell.edu>
Date: Mon, 23 Jun 2014 12:15:50 -0400
From: Ken Brown <kbrown AT cornell DOT edu>
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 AT cygwin DOT com
Subject: Re: getaddrinfo : Non-recoverable failure in name resolution
References: <53A81259 DOT 4080300 AT gmail DOT com> <20140623122510 DOT GD1803 AT calimero DOT vinschen DOT de> <53A82688 DOT 9010005 AT gmail DOT com>
In-Reply-To: <53A82688.9010005@gmail.com>
X-IsSubscribed: yes

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019