Re: [PATCH] "could not reattach to shared memory" on Windows

Lists: pgsql-hackers
From: Etienne Dube <etdube(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH] "could not reattach to shared memory" on Windows
Date: 2010-02-08 22:24:45
Message-ID: 4B708F2D.4010209@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi,

We've come across this issue on 8.2.15 on a Windows Server 2008
instance. I noticed the patch hasn't been applied to the 8.2 branch yet.
Any chances that this will be part of an eventual 8.2.16 release? Do you
need more testing and feedback before commiting the patch?

Thanks,

Etienne Dube

> * *From*: Magnus Hagander <magnus(at)hagander(dot)net>
> * *To*: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
> * *Cc*: Tsutomu Yamada <tsutomu(at)sraoss(dot)co(dot)jp>, Alvaro Herrera
> <alvherre(at)commandprompt(dot)com>, pgsql-hackers(at)postgresql(dot)org, Dave
> Page <dpage(at)pgadmin(dot)org>
> * *Subject*: Re: [PATCH] "could not reattach to shared memory" on
> Windows
> * *Date*: Tue, 11 Aug 2009 17:14:08 +0200
> * *Message-id*:
> <9837222c0908110814n414b2fcbxcaf7c0e1fcc05999(at)mail(dot)gmail(dot)com
> <http://archives.postgresql.org/pgsql-hackers/2009-08/msg00894.php>>
>
> ------------------------------------------------------------------------
> On Tue, Aug 11, 2009 at 16:30, Magnus Hagander<magnus(at)hagander(dot)net> wrote:
> > On Mon, Aug 10, 2009 at 19:33, Magnus Hagander<magnus(at)hagander(dot)net> wrote:
> >> On Mon, Aug 10, 2009 at 16:58, Tom Lane<tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >>> Magnus Hagander <magnus(at)hagander(dot)net> writes:
> >>>> On Mon, Aug 10, 2009 at 16:10, Tom Lane<tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >>>>> 8.2 as well, no?
> >>>
> >>>> 8.2 has a different shmem implementation - the one that emulates sysv
> >>>> shmem. The patch will need to be changed around for that, and I
> >>>> haven't looked at that. It may be worthwhile to do that, but it's a
> >>>> separate patch, so let's get it out in 8.3 and 8.4 first.
> >>>
> >>> If it's at all hard to do, I could see deprecating 8.2 for Windows
> >>> instead.
> >>
> >> I haven't looked at how much work it would be at all yet. So let's do
> >> that before we decide to deprecate anything. As mentioned downthread,
> >> 8.2 is a very widespread release, and we really want to avoid
> >> deprecating it.
> >
> > Here's an attempt at a backport to 8.2. I haven't examined it in
> > detail, but it passes "make check" on mingw.
> >
> > Comments?
>
> I've also built a binary that should be copy:able on top of an 8.2.13
> installation made from the standard installer, to test this feature.
> Anybody on 8.2 on Windows, please give it a shot and let us know how
> it works.
>
> http://www.hagander.net/pgsql/postgres_exe_virtualalloc_8_2.zip
>
>
> --
> Magnus Hagander
>

> Me: http://www.hagander.net/
> Work: http://www.redpill-linpro.com/
>
>


From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Etienne Dube <etdube(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] "could not reattach to shared memory" on Windows
Date: 2010-02-08 22:33:46
Message-ID: 9837222c1002081433k46433af5n83206d70df425d74@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

IIRC, we've had zero reports on whether the patch worked at all on 8.2
in an environment where the problem actually existed. So yes, some
testing and feedback would be much apprecaited.

//Magnus

2010/2/8 Etienne Dube <etdube(at)gmail(dot)com>:
> Hi,
>
> We've come across this issue on 8.2.15 on a Windows Server 2008 instance. I noticed the patch hasn't been applied to the 8.2 branch yet. Any chances that this will be part of an eventual 8.2.16 release? Do you need more testing and feedback before commiting the patch?
>
> Thanks,
>
> Etienne Dube
>
>
>>    * *From*: Magnus Hagander <magnus(at)hagander(dot)net>
>>    * *To*: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
>>    * *Cc*: Tsutomu Yamada <tsutomu(at)sraoss(dot)co(dot)jp>, Alvaro Herrera
>>      <alvherre(at)commandprompt(dot)com>, pgsql-hackers(at)postgresql(dot)org, Dave
>>      Page <dpage(at)pgadmin(dot)org>
>>    * *Subject*: Re: [PATCH] "could not reattach to shared memory" on
>>      Windows
>>    * *Date*: Tue, 11 Aug 2009 17:14:08 +0200
>>    * *Message-id*:
>>      <9837222c0908110814n414b2fcbxcaf7c0e1fcc05999(at)mail(dot)gmail(dot)com
>>      <http://archives.postgresql.org/pgsql-hackers/2009-08/msg00894.php>>
>>
>> ------------------------------------------------------------------------
>> On Tue, Aug 11, 2009 at 16:30, Magnus Hagander<magnus(at)hagander(dot)net> wrote:
>> > On Mon, Aug 10, 2009 at 19:33, Magnus Hagander<magnus(at)hagander(dot)net> wrote:
>> >> On Mon, Aug 10, 2009 at 16:58, Tom Lane<tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> >>> Magnus Hagander <magnus(at)hagander(dot)net> writes:
>> >>>> On Mon, Aug 10, 2009 at 16:10, Tom Lane<tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> >>>>> 8.2 as well, no?
>> >>>
>> >>>> 8.2 has a different shmem implementation - the one that emulates sysv
>> >>>> shmem. The patch will need to be changed around for that, and I
>> >>>> haven't looked at that. It may be worthwhile to do that, but it's a
>> >>>> separate patch, so let's get it out in 8.3 and 8.4 first.
>> >>>
>> >>> If it's at all hard to do, I could see deprecating 8.2 for Windows
>> >>> instead.
>> >>
>> >> I haven't looked at how much work it would be at all yet. So let's do
>> >> that before we decide to deprecate anything. As mentioned downthread,
>> >> 8.2 is a very widespread release, and we really want to avoid
>> >> deprecating it.
>> >
>> > Here's an attempt at a backport to 8.2. I haven't examined it  in
>> > detail, but it passes "make check" on mingw.
>> >
>> > Comments?
>>
>> I've also built a binary that should be copy:able on top of an 8.2.13
>> installation made from the standard installer, to test this feature.
>> Anybody on 8.2 on Windows, please give it a shot and let us know how
>> it works.
>>
>> http://www.hagander.net/pgsql/postgres_exe_virtualalloc_8_2.zip
>>
>>
>> --
>>  Magnus Hagander
>>
>
>>  Me: http://www.hagander.net/
>>  Work: http://www.redpill-linpro.com/
>>
>>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/


From: Etienne Dube <etdube(at)gmail(dot)com>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] "could not reattach to shared memory" on Windows
Date: 2010-02-09 21:09:16
Message-ID: 4B71CEFC.6080807@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Magnus Hagander wrote:
> IIRC, we've had zero reports on whether the patch worked at all on 8.2
> in an environment where the problem actually existed. So yes, some
> testing and feedback would be much apprecaited.
>
> //Magnus
>

Thanks for your quick reply.
We upgraded to Service Pack 2 and it solved the problem. Nevertheless,
I'll try to reproduce the issue under a Win2008 SP1 VM to see whether
the patch makes a difference. 8.2.x win32 binaries are built using MinGW
right?

Etienne

> 2010/2/8 Etienne Dube <etdube(at)gmail(dot)com>:
>
>> Hi,
>>
>> We've come across this issue on 8.2.15 on a Windows Server 2008 instance. I noticed the patch hasn't been applied to the 8.2 branch yet. Any chances that this will be part of an eventual 8.2.16 release? Do you need more testing and feedback before commiting the patch?
>>
>> Thanks,
>>
>> Etienne Dube
>>
>>
>>
>>> * *From*: Magnus Hagander <magnus(at)hagander(dot)net>
>>> * *To*: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
>>> * *Cc*: Tsutomu Yamada <tsutomu(at)sraoss(dot)co(dot)jp>, Alvaro Herrera
>>> <alvherre(at)commandprompt(dot)com>, pgsql-hackers(at)postgresql(dot)org, Dave
>>> Page <dpage(at)pgadmin(dot)org>
>>> * *Subject*: Re: [PATCH] "could not reattach to shared memory" on
>>> Windows
>>> * *Date*: Tue, 11 Aug 2009 17:14:08 +0200
>>> * *Message-id*:
>>> <9837222c0908110814n414b2fcbxcaf7c0e1fcc05999(at)mail(dot)gmail(dot)com
>>> <http://archives.postgresql.org/pgsql-hackers/2009-08/msg00894.php>>
>>>
>>> ------------------------------------------------------------------------
>>> On Tue, Aug 11, 2009 at 16:30, Magnus Hagander<magnus(at)hagander(dot)net> wrote:
>>>
>>>> On Mon, Aug 10, 2009 at 19:33, Magnus Hagander<magnus(at)hagander(dot)net> wrote:
>>>>
>>>>> On Mon, Aug 10, 2009 at 16:58, Tom Lane<tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>>>>
>>>>>> Magnus Hagander <magnus(at)hagander(dot)net> writes:
>>>>>>
>>>>>>> On Mon, Aug 10, 2009 at 16:10, Tom Lane<tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>>>>>>
>>>>>>>> 8.2 as well, no?
>>>>>>>>
>>>>>>> 8.2 has a different shmem implementation - the one that emulates sysv
>>>>>>> shmem. The patch will need to be changed around for that, and I
>>>>>>> haven't looked at that. It may be worthwhile to do that, but it's a
>>>>>>> separate patch, so let's get it out in 8.3 and 8.4 first.
>>>>>>>
>>>>>> If it's at all hard to do, I could see deprecating 8.2 for Windows
>>>>>> instead.
>>>>>>
>>>>> I haven't looked at how much work it would be at all yet. So let's do
>>>>> that before we decide to deprecate anything. As mentioned downthread,
>>>>> 8.2 is a very widespread release, and we really want to avoid
>>>>> deprecating it.
>>>>>
>>>> Here's an attempt at a backport to 8.2. I haven't examined it in
>>>> detail, but it passes "make check" on mingw.
>>>>
>>>> Comments?
>>>>
>>> I've also built a binary that should be copy:able on top of an 8.2.13
>>> installation made from the standard installer, to test this feature.
>>> Anybody on 8.2 on Windows, please give it a shot and let us know how
>>> it works.
>>>
>>> http://www.hagander.net/pgsql/postgres_exe_virtualalloc_8_2.zip
>>>
>>>
>>> --
>>> Magnus Hagander
>>>
>>>
>>> Me: http://www.hagander.net/
>>> Work: http://www.redpill-linpro.com/
>>>
>>>
>>>
>> --
>> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-hackers
>>
>>
>
>
>
>


From: Etienne Dube <etdube(at)gmail(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] "could not reattach to shared memory" on Windows
Date: 2010-07-20 15:31:34
Message-ID: 4C45C156.2060807@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 09/02/2010 4:09 PM, Etienne Dube wrote:
> Magnus Hagander wrote:
>> IIRC, we've had zero reports on whether the patch worked at all on 8.2
>> in an environment where the problem actually existed. So yes, some
>> testing and feedback would be much apprecaited.
>>
>> //Magnus
>
> Thanks for your quick reply.
> We upgraded to Service Pack 2 and it solved the problem. Nevertheless,
> I'll try to reproduce the issue under a Win2008 SP1 VM to see whether
> the patch makes a difference. 8.2.x win32 binaries are built using
> MinGW right?
>
> Etienne
>
>

The "could not reattach to shared memory" bug came back to bite us, this
time on a production machine running Windows Server 2008 R2 x64. I
manually applied the patch against the 8.2.17 sources and installed the
build on a test server. It has been running for two days without any
issue. We'll see after a while if the patch actually fixes the problem
(it seems to happen only after the postgres service has been up and
running for some time) but in case you want to include this fix in a
future 8.2.18 release, I've attached the new patch to apply against the
REL8_2_STABLE branch.

Etienne

Attachment Content-Type Size
pgsql-REL8_2_STABLE_virtualalloc.patch text/plain 5.7 KB

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Etienne Dube <etdube(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] "could not reattach to shared memory" on Windows
Date: 2010-07-23 13:55:15
Message-ID: AANLkTim128xVBMreFFOxAw04dA5akoS3BRuZaU8rAJbY@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Jul 20, 2010 at 17:31, Etienne Dube <etdube(at)gmail(dot)com> wrote:
> On 09/02/2010 4:09 PM, Etienne Dube wrote:
>>
>> Magnus Hagander wrote:
>>>
>>> IIRC, we've had zero reports on whether the patch worked at all on 8.2
>>> in an environment where the problem actually existed. So yes, some
>>> testing and feedback would be much apprecaited.
>>>
>>> //Magnus
>>
>> Thanks for your quick reply.
>> We upgraded to Service Pack 2 and it solved the problem. Nevertheless,
>> I'll try to reproduce the issue under a Win2008 SP1 VM to see whether the
>> patch makes a difference. 8.2.x win32 binaries are built using MinGW right?
>>
>> Etienne
>>
>>
>
>
> The "could not reattach to shared memory" bug came back to bite us, this
> time on a production machine running Windows Server 2008 R2 x64. I manually
> applied the patch against the 8.2.17 sources and installed the build on a
> test server. It has been running for two days without any issue. We'll see
> after a while if the patch actually fixes the problem (it seems to happen
> only after the postgres service has been up and running for some time) but
> in case you want to include this fix in a future 8.2.18 release, I've
> attached the new patch to apply against the REL8_2_STABLE branch.

Yes, I think it's time to backpatch this to 8.2 - it has worked very
well on 8.3 and 8.4, and we've had a couple of good reports on 8.2 by
now. So I've done that, so it should be in the next 8.2 version.

In fact, there was a small bug in the patch that broke all non-win32
platforms, so I fixed that while at it :-)

--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/