Re: A note about testing EXEC_BACKEND on recent Linuxen - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: A note about testing EXEC_BACKEND on recent Linuxen
Date
Msg-id 200602011939.k11JdUf20876@candle.pha.pa.us
Whole thread Raw
In response to Re: A note about testing EXEC_BACKEND on recent Linuxen  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: A note about testing EXEC_BACKEND on recent Linuxen
List pgsql-hackers
Tom Lane wrote:
> Martijn van Oosterhout <kleptog@svana.org> writes:
> > Hmm, are there no other ways that this problem can manifest itself?
> > ISTM that we're relying completely on the kernel to map it in the same
> > place each time. Maybe one day someone changes the startup procedure to
> > allocate some more memory and it gets mapped somewhere else.
> 
> In the normal non-EXEC_BACKEND scenario, there's no issue, so I see no
> great need to worry about this unduly.
> 
> > A better solution would be to explicitly map it in the child processes.
> > Basically, store the shared memory base at the beginning of the shared
> > memory block. Then when the child maps it it can verify the location.
> > It if doesn't match, unmap and remap at the right place.
> 
> That is utterly irrelevant to the problem, unfortunately; the shmat
> request already specifies where we need to map it, and the problem
> arises when that bit of address space is already taken in the child
> process.

FYI, the shared memory address was originally relocatable by using
offsets to address it from the child, but now that we use fork() on
Unix, it isn't an issue, and Win32 seems to be OK.

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: A note about testing EXEC_BACKEND on recent Linuxen
Next
From: Tom Lane
Date:
Subject: Re: A note about testing EXEC_BACKEND on recent Linuxen