aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2006-02-01 16:00:06 +0000
committerBruce Momjian <bruce@momjian.us>2006-02-01 16:00:06 +0000
commit47a86fa02d0ff58438dea2ef2005a6cd8938f8c4 (patch)
treeef7f8d573ed7f098f9c7481a0988668b2e507fc9 /src
parent802c7aa30f0832246a8de71b254da1cf7d6c737c (diff)
downloadpostgresql-47a86fa02d0ff58438dea2ef2005a6cd8938f8c4.tar.gz
postgresql-47a86fa02d0ff58438dea2ef2005a6cd8938f8c4.zip
Add code comment about Linux stack randomization and shared memory.
Diffstat (limited to 'src')
-rw-r--r--src/backend/postmaster/postmaster.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index 78d0471f85d..a89be34c099 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -37,7 +37,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.480 2006/02/01 00:31:59 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.481 2006/02/01 16:00:06 momjian Exp $
*
* NOTES
*
@@ -3336,7 +3336,18 @@ SubPostmasterMain(int argc, char *argv[])
/* Need a PGPROC to run CreateSharedMemoryAndSemaphores */
InitProcess();
- /* Attach process to shared data structures */
+ /*
+ * 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
+ *
+ * This prevents a randomized stack base address that causes
+ * child shared memory to be at a different address than
+ * the parent, making it impossible to attached to shared
+ * memory. Return the value to '1' when finished.
+ */
CreateSharedMemoryAndSemaphores(false, 0);
/* And run the backend */