Skip site navigation (1) Skip section navigation (2)

Re: mingw check hung

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: mingw check hung
Date: 2009-01-29 21:36:47
Message-ID: 4982216F.4000100@hagander.net (view raw or flat)
Thread:
Lists: pgsql-hackers
Andrew Dunstan wrote:
> 
> 
> Magnus Hagander wrote:
>>> Specifically, it's the SetEnvironmentVariable() call from
>>> pgwin32_putenv() called from pgwin32_unsetenv(). When this is disabled
>>> things work just fine.
>>>     
>>
>> That's strange :( What arguments are it sent to the function? Since this
>> is an API function, it really shouldn't behave differently between mingw
>> and msvc, so it must be something that goes wrong with the arguments.
>>
>> Also, Tom mentioned earlier that we may be including *two* replacements
>> for unsetenv(), which could be what's causing the problem. Can you check
>> if that is happening and try to disable the one in port/unsetenv.c and
>> see if that changes things?
>>
>>
>>   
> 
> I've already ruled out that hypothesis by forcing the call direct to
> pgwin32_unsetenv() instead of relying on the macro, in initdb.c.
> 
> There are only two such calls in initdb.c: the arguments are "LC_ALL"
> and "PGCLIENTENCODING".
> 
> I wonder if this version of SetEnvironmentVariable is sufficiently dumb
> that it fails badly if given a NULL second argument for a value that is
> not in fact in the environment (as I would normally expect of these on
> Windows)?

But that should be a win32 API call. It's not a runtime call. So it
should be identical between mingw and msvc!

Try removing the code that sets it to NULL if it's empty string. Having
it as empty string made it fail on MSVC, and the API documentation says
it should be NULL, but maybe mingw is somehow intercepting the call and
breaking it...

//Magnus


In response to

Responses

pgsql-hackers by date

Next:From: Andrew DunstanDate: 2009-01-29 22:28:25
Subject: Re: mingw check hung
Previous:From: David E. WheelerDate: 2009-01-29 21:08:51
Subject: Should IS DISTINCT FROM work with ANY()?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group