Re: [HACKERS] A note about testing EXEC_BACKEND on recent Linuxen

2006-02-01 Thread Bruce Momjian
Added code comment: /* * Attach process to shared data structures. If testing * EXEC_BACKEND on Linux, you must run this as root * before starting the postmaster: * * echo 0 /proc/sys/kernel/randomize_va_space * *

Re: [HACKERS] A note about testing EXEC_BACKEND on recent Linuxen

2006-02-01 Thread Martijn van Oosterhout
On Wed, Feb 01, 2006 at 10:59:39AM -0500, Bruce Momjian wrote: * Attach process to shared data structures. If testing * EXEC_BACKEND on Linux, you must run this as root * before starting the postmaster: * * echo 0

Re: [HACKERS] A note about testing EXEC_BACKEND on recent Linuxen

2006-02-01 Thread Tom Lane
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

Re: [HACKERS] A note about testing EXEC_BACKEND on recent Linuxen

2006-02-01 Thread Bruce Momjian
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

Re: [HACKERS] A note about testing EXEC_BACKEND on recent Linuxen

2006-02-01 Thread Tom Lane
Bruce Momjian pgman@candle.pha.pa.us writes: 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. In the worst case we could go back to using offsets everywhere,

Re: [HACKERS] A note about testing EXEC_BACKEND on recent Linuxen

2006-02-01 Thread Bruce Momjian
Tom Lane wrote: Bruce Momjian pgman@candle.pha.pa.us writes: 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. In the worst case we could go back to

Re: [HACKERS] A note about testing EXEC_BACKEND on recent Linuxen

2006-01-28 Thread Mitchell Skinner
On Thu, 2006-01-26 at 18:40 -0500, Tom Lane wrote: You can work around this by doing (as root) echo 0 /proc/sys/kernel/randomize_va_space before starting the postmaster. You'll probably want to set it back to 1 when done experimenting with EXEC_BACKEND, since address randomization is a

[HACKERS] A note about testing EXEC_BACKEND on recent Linuxen

2006-01-26 Thread Tom Lane
I just wasted a couple hours trying to determine why an EXEC_BACKEND build would randomly fail on Fedora Core 4. It seems the reason is that by default, recent Linux kernels randomize the stack base address --- not by a lot, but enough to cause child processes to sometimes be unable to attach to