_USE_32BIT_TIME_T Patch

Lists: pgsql-hackers
From: Owais Khan <owais(dot)khan(at)enterprisedb(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Hamid Quddus <hamid(dot)quddus(at)enterprisedb(dot)com>
Subject: _USE_32BIT_TIME_T Patch
Date: 2012-08-30 05:34:35
Message-ID: CAC2EunWgu3Nk26yXqjz=M=UuTBTVndz0B1LtLz9VqV=G=Fgnww@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hello,

We are getting crash while using plperl on Win32 as ActiveState perl(Win32)
uses 32-bit time_t structures. So, We have to compile DB Server's code also
with 32-bit time_t structure.

Patch is adding _USE_32BIT_TIME_T in preprocessor definitions in case
platform is Windows-32 for all project files.

Thanks & Regards,

Owais.

Attachment Content-Type Size
MSBuildProject_PG_Patch application/octet-stream 1.3 KB

From: Dave Page <dpage(at)pgadmin(dot)org>
To: Owais Khan <owais(dot)khan(at)enterprisedb(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, Hamid Quddus <hamid(dot)quddus(at)enterprisedb(dot)com>
Subject: Re: _USE_32BIT_TIME_T Patch
Date: 2012-08-30 12:39:36
Message-ID: CA+OCxox6enG7FB=rNUu0HLLyRgb07ZPThhfgCDTutTkUkajoig@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, Aug 30, 2012 at 6:34 AM, Owais Khan <owais(dot)khan(at)enterprisedb(dot)com> wrote:
> Hello,
>
> We are getting crash while using plperl on Win32 as ActiveState perl(Win32)
> uses 32-bit time_t structures. So, We have to compile DB Server's code also
> with 32-bit time_t structure.
>
> Patch is adding _USE_32BIT_TIME_T in preprocessor definitions in case
> platform is Windows-32 for all project files.

For additional background info, we did originally define this macro
for compatibility with third party code:

http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=22867ab9867a145b676f906b98f491c4496a70da

however it got removed here for some reason:

http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=cd004067742ee16ee63e55abfb4acbd5f09fbaab

The bottom line is, without it, pl/perl will crash with modern
versions of ActiveState Perl on Win32 (Windows users cannot use
Strawberry Perl as it doesn't contain the shared library we need).

This should definitely go in 9.2, and ideally the earlier branches
that didn't have it defined as well (this has been reported in the
past for 9.1 - for example;
http://archives.postgresql.org/pgsql-bugs/2012-04/msg00054.php) -
though I'm a little worried that adding it there may cause other
existing addons to require recompilation.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


From: Dave Page <dpage(at)pgadmin(dot)org>
To: Owais Khan <owais(dot)khan(at)enterprisedb(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, Hamid Quddus <hamid(dot)quddus(at)enterprisedb(dot)com>
Subject: Re: _USE_32BIT_TIME_T Patch
Date: 2012-08-31 15:05:23
Message-ID: CA+OCxoxTTjNctZYBA=3qmYJihfu24Q8mAcX8i=ZgS5DA14kyng@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

I've added this to the release blockers section for 9.2 on the wiki,
as without it, pl/perl is unusable on Win32.

On Thu, Aug 30, 2012 at 1:39 PM, Dave Page <dpage(at)pgadmin(dot)org> wrote:
> On Thu, Aug 30, 2012 at 6:34 AM, Owais Khan <owais(dot)khan(at)enterprisedb(dot)com> wrote:
>> Hello,
>>
>> We are getting crash while using plperl on Win32 as ActiveState perl(Win32)
>> uses 32-bit time_t structures. So, We have to compile DB Server's code also
>> with 32-bit time_t structure.
>>
>> Patch is adding _USE_32BIT_TIME_T in preprocessor definitions in case
>> platform is Windows-32 for all project files.
>
> For additional background info, we did originally define this macro
> for compatibility with third party code:
>
> http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=22867ab9867a145b676f906b98f491c4496a70da
>
> however it got removed here for some reason:
>
> http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=cd004067742ee16ee63e55abfb4acbd5f09fbaab
>
> The bottom line is, without it, pl/perl will crash with modern
> versions of ActiveState Perl on Win32 (Windows users cannot use
> Strawberry Perl as it doesn't contain the shared library we need).
>
> This should definitely go in 9.2, and ideally the earlier branches
> that didn't have it defined as well (this has been reported in the
> past for 9.1 - for example;
> http://archives.postgresql.org/pgsql-bugs/2012-04/msg00054.php) -
> though I'm a little worried that adding it there may cause other
> existing addons to require recompilation.
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Dave Page <dpage(at)pgadmin(dot)org>
Cc: Owais Khan <owais(dot)khan(at)enterprisedb(dot)com>, pgsql-hackers(at)postgresql(dot)org, Hamid Quddus <hamid(dot)quddus(at)enterprisedb(dot)com>
Subject: Re: _USE_32BIT_TIME_T Patch
Date: 2012-08-31 15:10:58
Message-ID: 5040D402.2000804@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


On 08/31/2012 11:05 AM, Dave Page wrote:
> I've added this to the release blockers section for 9.2 on the wiki,
> as without it, pl/perl is unusable on Win32.

I'll have a look at it today.

cheers

andrew


From: Dave Page <dpage(at)pgadmin(dot)org>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Owais Khan <owais(dot)khan(at)enterprisedb(dot)com>, pgsql-hackers(at)postgresql(dot)org, Hamid Quddus <hamid(dot)quddus(at)enterprisedb(dot)com>
Subject: Re: _USE_32BIT_TIME_T Patch
Date: 2012-08-31 15:14:51
Message-ID: CA+OCxoxppLWa5uCmRY0QVRMzb-Hoj2nU+7pBE9BUtPQLZvLv_A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, Aug 31, 2012 at 4:10 PM, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
>
> On 08/31/2012 11:05 AM, Dave Page wrote:
>>
>> I've added this to the release blockers section for 9.2 on the wiki,
>> as without it, pl/perl is unusable on Win32.
>
>
>
> I'll have a look at it today.

Thanks Andrew - minor clarification; unusable on MSVC/Win32. I suspect
Mingw builds may be fine, as they use a much older runtime. Of course,
we've used MSVC++ for the installer builds for years now.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Dave Page <dpage(at)pgadmin(dot)org>
Cc: Owais Khan <owais(dot)khan(at)enterprisedb(dot)com>, pgsql-hackers(at)postgresql(dot)org, Hamid Quddus <hamid(dot)quddus(at)enterprisedb(dot)com>
Subject: Re: _USE_32BIT_TIME_T Patch
Date: 2012-08-31 15:57:54
Message-ID: 5040DF02.8060001@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


On 08/31/2012 11:14 AM, Dave Page wrote:
> On Fri, Aug 31, 2012 at 4:10 PM, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
>> On 08/31/2012 11:05 AM, Dave Page wrote:
>>> I've added this to the release blockers section for 9.2 on the wiki,
>>> as without it, pl/perl is unusable on Win32.
>>
>>
>> I'll have a look at it today.
> Thanks Andrew - minor clarification; unusable on MSVC/Win32. I suspect
> Mingw builds may be fine, as they use a much older runtime. Of course,
> we've used MSVC++ for the installer builds for years now.

What exactly is the known combination of things that don't work, and
things that do work? My only 32 bit test environment for this (ASPerl
5.12.2 build 1202 [293621], built Sep 6, 2010, Visual C++ Express 2008,
Windows XP SP3) doesn't seem to have any problem building and running
plperl. That makes it tough to test if I don't know what exactly needs
to change to break things.

cheers

andrew


From: Dave Page <dpage(at)pgadmin(dot)org>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Owais Khan <owais(dot)khan(at)enterprisedb(dot)com>, pgsql-hackers(at)postgresql(dot)org, Hamid Quddus <hamid(dot)quddus(at)enterprisedb(dot)com>
Subject: Re: _USE_32BIT_TIME_T Patch
Date: 2012-08-31 16:18:51
Message-ID: CA+OCxowbNX1rLj2bBO0ow-gxXNaU6m1=d-6+9RCZssQ2rBeRkQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, Aug 31, 2012 at 4:57 PM, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
>
> On 08/31/2012 11:14 AM, Dave Page wrote:
>>
>> On Fri, Aug 31, 2012 at 4:10 PM, Andrew Dunstan <andrew(at)dunslane(dot)net>
>> wrote:
>>>
>>> On 08/31/2012 11:05 AM, Dave Page wrote:
>>>>
>>>> I've added this to the release blockers section for 9.2 on the wiki,
>>>> as without it, pl/perl is unusable on Win32.
>>>
>>>
>>>
>>> I'll have a look at it today.
>>
>> Thanks Andrew - minor clarification; unusable on MSVC/Win32. I suspect
>> Mingw builds may be fine, as they use a much older runtime. Of course,
>> we've used MSVC++ for the installer builds for years now.
>
>
>
> What exactly is the known combination of things that don't work, and things
> that do work? My only 32 bit test environment for this (ASPerl 5.12.2 build
> 1202 [293621], built Sep 6, 2010, Visual C++ Express 2008, Windows XP SP3)
> doesn't seem to have any problem building and running plperl. That makes it
> tough to test if I don't know what exactly needs to change to break things.

We're using VC++ 2010 Pro with ASPerl 5.14.2.1402 for 9.2, and VC++
2008 Pro with ASPerl 5.14.1.1401 at present. Our CM team have tried
multiple versions of Perl though, and seen the issue with 5.10 and
5.12 as well though. 5.8 seemed to be OK.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


From: Dave Page <dpage(at)pgadmin(dot)org>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Owais Khan <owais(dot)khan(at)enterprisedb(dot)com>, pgsql-hackers(at)postgresql(dot)org, Hamid Quddus <hamid(dot)quddus(at)enterprisedb(dot)com>
Subject: Re: _USE_32BIT_TIME_T Patch
Date: 2012-08-31 16:23:02
Message-ID: CA+OCxoy+xt-P5d0cfnx+qJZQZQAAigiWG-d6+dS=58oCYON7iQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, Aug 31, 2012 at 5:18 PM, Dave Page <dpage(at)pgadmin(dot)org> wrote:
> On Fri, Aug 31, 2012 at 4:57 PM, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
>>
>> On 08/31/2012 11:14 AM, Dave Page wrote:
>>>
>>> On Fri, Aug 31, 2012 at 4:10 PM, Andrew Dunstan <andrew(at)dunslane(dot)net>
>>> wrote:
>>>>
>>>> On 08/31/2012 11:05 AM, Dave Page wrote:
>>>>>
>>>>> I've added this to the release blockers section for 9.2 on the wiki,
>>>>> as without it, pl/perl is unusable on Win32.
>>>>
>>>>
>>>>
>>>> I'll have a look at it today.
>>>
>>> Thanks Andrew - minor clarification; unusable on MSVC/Win32. I suspect
>>> Mingw builds may be fine, as they use a much older runtime. Of course,
>>> we've used MSVC++ for the installer builds for years now.
>>
>>
>>
>> What exactly is the known combination of things that don't work, and things
>> that do work? My only 32 bit test environment for this (ASPerl 5.12.2 build
>> 1202 [293621], built Sep 6, 2010, Visual C++ Express 2008, Windows XP SP3)
>> doesn't seem to have any problem building and running plperl. That makes it
>> tough to test if I don't know what exactly needs to change to break things.
>
> We're using VC++ 2010 Pro with ASPerl 5.14.2.1402 for 9.2, and VC++
> 2008 Pro with ASPerl 5.14.1.1401 at present. Our CM team have tried
> multiple versions of Perl though, and seen the issue with 5.10 and
> 5.12 as well though. 5.8 seemed to be OK.

Oh - and a further data point; we discussed the issue with one of the
senior engineers at ActiveState who confirmed that they do use
_USE_32BIT_TIME_T on Win32, and that not using it when compiling apps
that link with Perl is a known cause of crashes amongst their users.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Dave Page <dpage(at)pgadmin(dot)org>
Cc: Owais Khan <owais(dot)khan(at)enterprisedb(dot)com>, pgsql-hackers(at)postgresql(dot)org, Hamid Quddus <hamid(dot)quddus(at)enterprisedb(dot)com>
Subject: Re: _USE_32BIT_TIME_T Patch
Date: 2012-08-31 16:37:48
Message-ID: 5040E85C.3010404@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


On 08/31/2012 12:18 PM, Dave Page wrote:
> On Fri, Aug 31, 2012 at 4:57 PM, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
>> On 08/31/2012 11:14 AM, Dave Page wrote:
>>> On Fri, Aug 31, 2012 at 4:10 PM, Andrew Dunstan <andrew(at)dunslane(dot)net>
>>> wrote:
>>>> On 08/31/2012 11:05 AM, Dave Page wrote:
>>>>> I've added this to the release blockers section for 9.2 on the wiki,
>>>>> as without it, pl/perl is unusable on Win32.
>>>>
>>>>
>>>> I'll have a look at it today.
>>> Thanks Andrew - minor clarification; unusable on MSVC/Win32. I suspect
>>> Mingw builds may be fine, as they use a much older runtime. Of course,
>>> we've used MSVC++ for the installer builds for years now.
>>
>>
>> What exactly is the known combination of things that don't work, and things
>> that do work? My only 32 bit test environment for this (ASPerl 5.12.2 build
>> 1202 [293621], built Sep 6, 2010, Visual C++ Express 2008, Windows XP SP3)
>> doesn't seem to have any problem building and running plperl. That makes it
>> tough to test if I don't know what exactly needs to change to break things.
> We're using VC++ 2010 Pro with ASPerl 5.14.2.1402 for 9.2, and VC++
> 2008 Pro with ASPerl 5.14.1.1401 at present. Our CM team have tried
> multiple versions of Perl though, and seen the issue with 5.10 and
> 5.12 as well though. 5.8 seemed to be OK.

OK so from that I'm guessing the issue is probably VC++ 2010, which I
don't have at all, let alone on a 32-bit machine :-(

Oh, well, I'll look and see if I feel comfortable about the patch anyway.

cheers

andrew


From: Dave Page <dpage(at)pgadmin(dot)org>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Owais Khan <owais(dot)khan(at)enterprisedb(dot)com>, pgsql-hackers(at)postgresql(dot)org, Hamid Quddus <hamid(dot)quddus(at)enterprisedb(dot)com>
Subject: Re: _USE_32BIT_TIME_T Patch
Date: 2012-08-31 16:41:44
Message-ID: CA+OCxozAP+H+_ZGF2jgDV4kMz3Fti+64mhF2es949D2MLr8zFA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, Aug 31, 2012 at 5:37 PM, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
>
> On 08/31/2012 12:18 PM, Dave Page wrote:
>>
>> On Fri, Aug 31, 2012 at 4:57 PM, Andrew Dunstan <andrew(at)dunslane(dot)net>
>> wrote:
>>>
>>> On 08/31/2012 11:14 AM, Dave Page wrote:
>>>>
>>>> On Fri, Aug 31, 2012 at 4:10 PM, Andrew Dunstan <andrew(at)dunslane(dot)net>
>>>> wrote:
>>>>>
>>>>> On 08/31/2012 11:05 AM, Dave Page wrote:
>>>>>>
>>>>>> I've added this to the release blockers section for 9.2 on the wiki,
>>>>>> as without it, pl/perl is unusable on Win32.
>>>>>
>>>>>
>>>>>
>>>>> I'll have a look at it today.
>>>>
>>>> Thanks Andrew - minor clarification; unusable on MSVC/Win32. I suspect
>>>> Mingw builds may be fine, as they use a much older runtime. Of course,
>>>> we've used MSVC++ for the installer builds for years now.
>>>
>>>
>>>
>>> What exactly is the known combination of things that don't work, and
>>> things
>>> that do work? My only 32 bit test environment for this (ASPerl 5.12.2
>>> build
>>> 1202 [293621], built Sep 6, 2010, Visual C++ Express 2008, Windows XP
>>> SP3)
>>> doesn't seem to have any problem building and running plperl. That makes
>>> it
>>> tough to test if I don't know what exactly needs to change to break
>>> things.
>>
>> We're using VC++ 2010 Pro with ASPerl 5.14.2.1402 for 9.2, and VC++
>> 2008 Pro with ASPerl 5.14.1.1401 at present. Our CM team have tried
>> multiple versions of Perl though, and seen the issue with 5.10 and
>> 5.12 as well though. 5.8 seemed to be OK.
>
>
> OK so from that I'm guessing the issue is probably VC++ 2010, which I don't
> have at all, let alone on a 32-bit machine :-(
>
> Oh, well, I'll look and see if I feel comfortable about the patch anyway.

It's only 2010 for 9.2. We're using 2008 with 9.1, which also exhibits
the problem (see the bug report linked in my first post on this
thread).

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Dave Page <dpage(at)pgadmin(dot)org>
Cc: Owais Khan <owais(dot)khan(at)enterprisedb(dot)com>, pgsql-hackers(at)postgresql(dot)org, Hamid Quddus <hamid(dot)quddus(at)enterprisedb(dot)com>
Subject: Re: _USE_32BIT_TIME_T Patch
Date: 2012-08-31 16:51:42
Message-ID: 5040EB9E.8070400@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


On 08/31/2012 12:41 PM, Dave Page wrote:
> On Fri, Aug 31, 2012 at 5:37 PM, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
>> On 08/31/2012 12:18 PM, Dave Page wrote:
>>> On Fri, Aug 31, 2012 at 4:57 PM, Andrew Dunstan <andrew(at)dunslane(dot)net>
>>> wrote:
>>>> On 08/31/2012 11:14 AM, Dave Page wrote:
>>>>> On Fri, Aug 31, 2012 at 4:10 PM, Andrew Dunstan <andrew(at)dunslane(dot)net>
>>>>> wrote:
>>>>>> On 08/31/2012 11:05 AM, Dave Page wrote:
>>>>>>> I've added this to the release blockers section for 9.2 on the wiki,
>>>>>>> as without it, pl/perl is unusable on Win32.
>>>>>>
>>>>>>
>>>>>> I'll have a look at it today.
>>>>> Thanks Andrew - minor clarification; unusable on MSVC/Win32. I suspect
>>>>> Mingw builds may be fine, as they use a much older runtime. Of course,
>>>>> we've used MSVC++ for the installer builds for years now.
>>>>
>>>>
>>>> What exactly is the known combination of things that don't work, and
>>>> things
>>>> that do work? My only 32 bit test environment for this (ASPerl 5.12.2
>>>> build
>>>> 1202 [293621], built Sep 6, 2010, Visual C++ Express 2008, Windows XP
>>>> SP3)
>>>> doesn't seem to have any problem building and running plperl. That makes
>>>> it
>>>> tough to test if I don't know what exactly needs to change to break
>>>> things.
>>> We're using VC++ 2010 Pro with ASPerl 5.14.2.1402 for 9.2, and VC++
>>> 2008 Pro with ASPerl 5.14.1.1401 at present. Our CM team have tried
>>> multiple versions of Perl though, and seen the issue with 5.10 and
>>> 5.12 as well though. 5.8 seemed to be OK.
>>
>> OK so from that I'm guessing the issue is probably VC++ 2010, which I don't
>> have at all, let alone on a 32-bit machine :-(
>>
>> Oh, well, I'll look and see if I feel comfortable about the patch anyway.
> It's only 2010 for 9.2. We're using 2008 with 9.1, which also exhibits
> the problem (see the bug report linked in my first post on this
> thread).

Well, that makes things harder to diagnose. Why isn't my 2008 / ASPerl
5.12.2 setup exhibiting the problem?

cheers

andrew


From: Dave Page <dpage(at)pgadmin(dot)org>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Owais Khan <owais(dot)khan(at)enterprisedb(dot)com>, pgsql-hackers(at)postgresql(dot)org, Hamid Quddus <hamid(dot)quddus(at)enterprisedb(dot)com>
Subject: Re: _USE_32BIT_TIME_T Patch
Date: 2012-08-31 17:10:50
Message-ID: CA+OCxoyU5q0kkGKVapPOhkV=L1SU0JPNP5YWR8fyay4T+XydUA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, Aug 31, 2012 at 5:51 PM, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
>
> On 08/31/2012 12:41 PM, Dave Page wrote:
>>
>> On Fri, Aug 31, 2012 at 5:37 PM, Andrew Dunstan <andrew(at)dunslane(dot)net>
>> wrote:
>>>
>>> On 08/31/2012 12:18 PM, Dave Page wrote:
>>>>
>>>> On Fri, Aug 31, 2012 at 4:57 PM, Andrew Dunstan <andrew(at)dunslane(dot)net>
>>>> wrote:
>>>>>
>>>>> On 08/31/2012 11:14 AM, Dave Page wrote:
>>>>>>
>>>>>> On Fri, Aug 31, 2012 at 4:10 PM, Andrew Dunstan <andrew(at)dunslane(dot)net>
>>>>>> wrote:
>>>>>>>
>>>>>>> On 08/31/2012 11:05 AM, Dave Page wrote:
>>>>>>>>
>>>>>>>> I've added this to the release blockers section for 9.2 on the wiki,
>>>>>>>> as without it, pl/perl is unusable on Win32.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> I'll have a look at it today.
>>>>>>
>>>>>> Thanks Andrew - minor clarification; unusable on MSVC/Win32. I suspect
>>>>>> Mingw builds may be fine, as they use a much older runtime. Of course,
>>>>>> we've used MSVC++ for the installer builds for years now.
>>>>>
>>>>>
>>>>>
>>>>> What exactly is the known combination of things that don't work, and
>>>>> things
>>>>> that do work? My only 32 bit test environment for this (ASPerl 5.12.2
>>>>> build
>>>>> 1202 [293621], built Sep 6, 2010, Visual C++ Express 2008, Windows XP
>>>>> SP3)
>>>>> doesn't seem to have any problem building and running plperl. That
>>>>> makes
>>>>> it
>>>>> tough to test if I don't know what exactly needs to change to break
>>>>> things.
>>>>
>>>> We're using VC++ 2010 Pro with ASPerl 5.14.2.1402 for 9.2, and VC++
>>>> 2008 Pro with ASPerl 5.14.1.1401 at present. Our CM team have tried
>>>> multiple versions of Perl though, and seen the issue with 5.10 and
>>>> 5.12 as well though. 5.8 seemed to be OK.
>>>
>>>
>>> OK so from that I'm guessing the issue is probably VC++ 2010, which I
>>> don't
>>> have at all, let alone on a 32-bit machine :-(
>>>
>>> Oh, well, I'll look and see if I feel comfortable about the patch anyway.
>>
>> It's only 2010 for 9.2. We're using 2008 with 9.1, which also exhibits
>> the problem (see the bug report linked in my first post on this
>> thread).
>
>
>
> Well, that makes things harder to diagnose. Why isn't my 2008 / ASPerl
> 5.12.2 setup exhibiting the problem?

No idea. Differences in the SDK perhaps? You're using VC++ Express
which (if memory serves) you have to download the SDK independently,
whereas we get a bundled, and possibly slightly different version with
the Pro edition.

As a side note - I'm not sure why _USE_32BIT_TIME_T was removed in the
first place; it was added specifically to avoid this sort of problem,
though iirc at the time we were thinking of extensions like Slony and
PostGIS being built with Mingw for use with the VC++ built server.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Dave Page <dpage(at)pgadmin(dot)org>
Cc: Owais Khan <owais(dot)khan(at)enterprisedb(dot)com>, pgsql-hackers(at)postgresql(dot)org, Hamid Quddus <hamid(dot)quddus(at)enterprisedb(dot)com>
Subject: Re: _USE_32BIT_TIME_T Patch
Date: 2012-08-31 18:23:28
Message-ID: 50410120.8010005@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


On 08/31/2012 01:10 PM, Dave Page wrote:
> On Fri, Aug 31, 2012 at 5:51 PM, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
>> On 08/31/2012 12:41 PM, Dave Page wrote:
>>> On Fri, Aug 31, 2012 at 5:37 PM, Andrew Dunstan <andrew(at)dunslane(dot)net>
>>> wrote:
>>>> On 08/31/2012 12:18 PM, Dave Page wrote:
>>>>> On Fri, Aug 31, 2012 at 4:57 PM, Andrew Dunstan <andrew(at)dunslane(dot)net>
>>>>> wrote:
>>>>>> On 08/31/2012 11:14 AM, Dave Page wrote:
>>>>>>> On Fri, Aug 31, 2012 at 4:10 PM, Andrew Dunstan <andrew(at)dunslane(dot)net>
>>>>>>> wrote:
>>>>>>>> On 08/31/2012 11:05 AM, Dave Page wrote:
>>>>>>>>> I've added this to the release blockers section for 9.2 on the wiki,
>>>>>>>>> as without it, pl/perl is unusable on Win32.
>>>>>>>>
>>>>>>>>
>>>>>>>> I'll have a look at it today.
>>>>>>> Thanks Andrew - minor clarification; unusable on MSVC/Win32. I suspect
>>>>>>> Mingw builds may be fine, as they use a much older runtime. Of course,
>>>>>>> we've used MSVC++ for the installer builds for years now.
>>>>>>
>>>>>>
>>>>>> What exactly is the known combination of things that don't work, and
>>>>>> things
>>>>>> that do work? My only 32 bit test environment for this (ASPerl 5.12.2
>>>>>> build
>>>>>> 1202 [293621], built Sep 6, 2010, Visual C++ Express 2008, Windows XP
>>>>>> SP3)
>>>>>> doesn't seem to have any problem building and running plperl. That
>>>>>> makes
>>>>>> it
>>>>>> tough to test if I don't know what exactly needs to change to break
>>>>>> things.
>>>>> We're using VC++ 2010 Pro with ASPerl 5.14.2.1402 for 9.2, and VC++
>>>>> 2008 Pro with ASPerl 5.14.1.1401 at present. Our CM team have tried
>>>>> multiple versions of Perl though, and seen the issue with 5.10 and
>>>>> 5.12 as well though. 5.8 seemed to be OK.
>>>>
>>>> OK so from that I'm guessing the issue is probably VC++ 2010, which I
>>>> don't
>>>> have at all, let alone on a 32-bit machine :-(
>>>>
>>>> Oh, well, I'll look and see if I feel comfortable about the patch anyway.
>>> It's only 2010 for 9.2. We're using 2008 with 9.1, which also exhibits
>>> the problem (see the bug report linked in my first post on this
>>> thread).
>>
>>
>> Well, that makes things harder to diagnose. Why isn't my 2008 / ASPerl
>> 5.12.2 setup exhibiting the problem?
> No idea. Differences in the SDK perhaps? You're using VC++ Express
> which (if memory serves) you have to download the SDK independently,
> whereas we get a bundled, and possibly slightly different version with
> the Pro edition.
>
> As a side note - I'm not sure why _USE_32BIT_TIME_T was removed in the
> first place; it was added specifically to avoid this sort of problem,
> though iirc at the time we were thinking of extensions like Slony and
> PostGIS being built with Mingw for use with the VC++ built server.

OK. Well, I didn't quite like the submitted patch for a couple of
reasons. First, it only affected VC2010 builds, and you said these
weren't the only ones affected. And second it didn't really highlight
what was being done.

So here are two patches, one for HEAD/9.2 and one for earlier releases,
that do this in a different way that is more obvious, and for all
versions of VC.

Please test. I will also test these.

cheers

andrew

Attachment Content-Type Size
mscv_use_32bit_time_t.patch text/x-patch 1.8 KB
mscv_use_32bit_time_t-older.patch text/x-patch 1.0 KB

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dave Page <dpage(at)pgadmin(dot)org>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Owais Khan <owais(dot)khan(at)enterprisedb(dot)com>, pgsql-hackers(at)postgresql(dot)org, Hamid Quddus <hamid(dot)quddus(at)enterprisedb(dot)com>
Subject: Re: _USE_32BIT_TIME_T Patch
Date: 2012-08-31 19:36:34
Message-ID: 17886.1346441794@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Dave Page <dpage(at)pgadmin(dot)org> writes:
> As a side note - I'm not sure why _USE_32BIT_TIME_T was removed in the
> first place; it was added specifically to avoid this sort of problem,
> though iirc at the time we were thinking of extensions like Slony and
> PostGIS being built with Mingw for use with the VC++ built server.

We removed it when we changed our internal time_t usage to 64 bits:
http://git.postgresql.org/gitweb/?p=postgresql.git&a=commitdiff&h=cd004067742ee16ee63e55abfb4acbd5f09fbaab
Possibly that was just a brain fade caused by failing to think about
the distinction between pg_time_t and system time_t. However, the
code has been like that since 8.4, and nobody complained before.
I share Andrew's unease about whether this issue is fully understood.

regards, tom lane


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Dave Page <dpage(at)pgadmin(dot)org>, Owais Khan <owais(dot)khan(at)enterprisedb(dot)com>, pgsql-hackers(at)postgresql(dot)org, Hamid Quddus <hamid(dot)quddus(at)enterprisedb(dot)com>
Subject: Re: _USE_32BIT_TIME_T Patch
Date: 2012-08-31 22:12:34
Message-ID: 504136D2.7090703@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


On 08/31/2012 03:36 PM, Tom Lane wrote:
> Dave Page <dpage(at)pgadmin(dot)org> writes:
>> As a side note - I'm not sure why _USE_32BIT_TIME_T was removed in the
>> first place; it was added specifically to avoid this sort of problem,
>> though iirc at the time we were thinking of extensions like Slony and
>> PostGIS being built with Mingw for use with the VC++ built server.
> We removed it when we changed our internal time_t usage to 64 bits:
> http://git.postgresql.org/gitweb/?p=postgresql.git&a=commitdiff&h=cd004067742ee16ee63e55abfb4acbd5f09fbaab
> Possibly that was just a brain fade caused by failing to think about
> the distinction between pg_time_t and system time_t. However, the
> code has been like that since 8.4, and nobody complained before.
> I share Andrew's unease about whether this issue is fully understood.
>
>

OTOH, the fact that we used to have it and nothing broke that we know of
is somewhat reassuring.

I'm not sure what we need to do to progress on this, especially re the
back branches.

cheers

andrew


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Dave Page <dpage(at)pgadmin(dot)org>, Owais Khan <owais(dot)khan(at)enterprisedb(dot)com>, pgsql-hackers(at)postgresql(dot)org, Hamid Quddus <hamid(dot)quddus(at)enterprisedb(dot)com>
Subject: Re: _USE_32BIT_TIME_T Patch
Date: 2012-08-31 22:39:27
Message-ID: 24454.1346452767@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> I'm not sure what we need to do to progress on this, especially re the
> back branches.

The calendar might help us here. 9.2 is due to wrap next week, but it
will likely be a couple of months before we contemplate new back-branch
releases. So we could push a fix that we don't have 100% confidence in,
knowing that there is time to recover before it will ship in any of the
proven branches. Releasing it in 9.2.0 will afford an opportunity for
more testing than we can do by ourselves.

That's not to take anything away from the fact that we ought to test as
many cases as we can now. But we do have some margin for error.

regards, tom lane


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Dave Page <dpage(at)pgadmin(dot)org>, Owais Khan <owais(dot)khan(at)enterprisedb(dot)com>, pgsql-hackers(at)postgresql(dot)org, Hamid Quddus <hamid(dot)quddus(at)enterprisedb(dot)com>
Subject: Re: _USE_32BIT_TIME_T Patch
Date: 2012-09-01 00:35:48
Message-ID: 50415864.9080103@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


On 08/31/2012 06:39 PM, Tom Lane wrote:
> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>> I'm not sure what we need to do to progress on this, especially re the
>> back branches.
> The calendar might help us here. 9.2 is due to wrap next week, but it
> will likely be a couple of months before we contemplate new back-branch
> releases. So we could push a fix that we don't have 100% confidence in,
> knowing that there is time to recover before it will ship in any of the
> proven branches. Releasing it in 9.2.0 will afford an opportunity for
> more testing than we can do by ourselves.
>
> That's not to take anything away from the fact that we ought to test as
> many cases as we can now. But we do have some margin for error.
>
>

OK, so I have tested it on my 32bit setup and it's working, so I'm going
to commit this for HEAD/9.2 now, so we can get that wider testing.

cheers

andrew


From: Dave Page <dpage(at)pgadmin(dot)org>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Owais Khan <owais(dot)khan(at)enterprisedb(dot)com>, pgsql-hackers(at)postgresql(dot)org, Hamid Quddus <hamid(dot)quddus(at)enterprisedb(dot)com>
Subject: Re: _USE_32BIT_TIME_T Patch
Date: 2012-09-03 07:57:33
Message-ID: CA+OCxozKm0dGob6fakPFsP-3i82Ry_9c3oiYedUkO9U+UYTLHQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Sat, Sep 1, 2012 at 1:35 AM, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
>
> On 08/31/2012 06:39 PM, Tom Lane wrote:
>>
>> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>>>
>>> I'm not sure what we need to do to progress on this, especially re the
>>> back branches.
>>
>> The calendar might help us here. 9.2 is due to wrap next week, but it
>> will likely be a couple of months before we contemplate new back-branch
>> releases. So we could push a fix that we don't have 100% confidence in,
>> knowing that there is time to recover before it will ship in any of the
>> proven branches. Releasing it in 9.2.0 will afford an opportunity for
>> more testing than we can do by ourselves.
>>
>> That's not to take anything away from the fact that we ought to test as
>> many cases as we can now. But we do have some margin for error.
>>
>>
>
>
>
> OK, so I have tested it on my 32bit setup and it's working, so I'm going to
> commit this for HEAD/9.2 now, so we can get that wider testing.

Thanks Andrew. Owais, can you please test on both PG and PPAS?

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company