Provide a way to control SysV shmem attach address in EXEC_BACKEND builds.
Provide a way to control SysV shmem attach address in EXEC_BACKEND builds.

In standard non-Windows builds, there's no particular reason to care what
address the kernel chooses to map the shared memory segment at.  However,
when building with EXEC_BACKEND, there's a risk that the chosen address
won't be available in all child processes.  Linux with ASLR enabled (which
it is by default) seems particularly at risk because it puts shmem segments
into the same area where it maps shared libraries.  We can work around
that by specifying a mapping address that's outside the range where
shared libraries could get mapped.  On x86_64 Linux, 0x7e0000000000
seems to work well.

This is only meant for testing/debugging purposes, so it doesn't seem
necessary to go as far as providing a GUC (or any user-visible
documentation, though we might change that later).  Instead, it's just
controlled by setting an environment variable PG_SHMEM_ADDR to the
desired attach address.

Back-patch to all supported branches, since the point here is to
remove intermittent buildfarm failures on EXEC_BACKEND animals.
Owners of affected animals will need to add a suitable setting of
PG_SHMEM_ADDR to their build_env configuration.

Discussion: 47cd5e31d0cf36cc2d48d35aee40fd9e60fb4ec0@sss.pgh.pa.us

lisakowen/gpdb,greenplum-db/gpdb,lisakowen/gpdb,50wu/gpdb,xinzweb/gpdb,adam8157/gpdb,lisakowen/gpdb,adam8157/gpdb,greenplum-db/gpdb,greenplum-db/gpdb,lisakowen/gpdb,50wu/gpdb,50wu/gpdb,greenplum-db/gpdb,xinzweb/gpdb,xinzweb/gpdb,50wu/gpdb,greenplum-db/gpdb,lisakowen/gpdb,xinzweb/gpdb,xinzweb/gpdb,50wu/gpdb,greenplum-db/gpdb,lisakowen/gpdb,xinzweb/gpdb,greenplum-db/gpdb,adam8157/gpdb,adam8157/gpdb,lisakowen/gpdb,greenplum-db/gpdb,xinzweb/gpdb,adam8157/gpdb,adam8157/gpdb,50wu/gpdb,50wu/gpdb,adam8157/gpdb,50wu/gpdb,adam8157/gpdb,xinzweb/gpdb,lisakowen/gpdb