Re: test failure on latest source - Mailing list pgsql-hackers

From Marco Atzeri
Subject Re: test failure on latest source
Date
Msg-id 53A8264B.6080907@gmail.com
Whole thread Raw
In response to Re: test failure on latest source  (Marco Atzeri <marco.atzeri@gmail.com>)
List pgsql-hackers
On 16/04/2014 18:55, Marco Atzeri wrote:
> On 16/04/2014 17:40, Tom Lane wrote:
>
>> The bigger picture though is that this code isn't failing on the
>> buildfarm.  So what we need to ask is what's different about Marco's
>> machine.
>
> good question.
> I checked again and I found that the fault is only on
> the cygwin 64 bit build but not on the cygwin 32 bit one.
>
> I was sure to have tested both, but it seems this time
> I missed the comparison.
>
>>             regards, tom lane
>
> Regards
> Marco
>

to close the issue, we have identified the fault in the getaddrinfo
system call on cygwin64.

"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."


Regards
Marco






pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Use a signal to trigger a memory context dump?
Next
From: Kevin Grittner
Date:
Subject: Re: tab completion for setting search_path