PIE breaks detection of available stack depth with getrlimit?

Tom Lane tgl at redhat.com
Tue Apr 16 21:59:01 UTC 2013


Pursuant to the recent discussion about using _hardened_build in more
packages, I tried turning it on in postgresql.  I was unpleasantly
surprised to find that that causes the package's regression tests to
fail, at least when running a 32-bit build in mock under a 64-bit
kernel.  The cause appears to be that getrlimit(RLIMIT_STACK) reports
an inflated value for the process's available stack space.

Just to make it more fun, the test doesn't always fail, which makes it
look like address space randomization is affecting how much stack space
you get, but not how much getrlimit tells you you've got.

While 32-bit-under-64-bit-kernel probably isn't very reflective of real
world database usage, it is reflective of what's going to happen in
koji, so I cannot enable _hardened_build until this is resolved.

So is this a kernel bug, or a userspace bug, and if the latter what
component should I file it against?

			regards, tom lane


More information about the devel mailing list