PIE breaks detection of available stack depth with getrlimit?

Tom Lane tgl at redhat.com
Wed Apr 17 14:10:52 UTC 2013


Dhiru Kholia <dhiru.kholia at gmail.com> writes:
> On 04/16/13 at 05:59pm, Tom Lane wrote:
>> 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.

> I am wondering why Ubuntu didn't hit this bug earlier since they have
> been shipping PIE enabled postgresql for a long time now.

I'd bet a nickel they don't bother to run the regression tests during
build.  It's something that might not get noticed quickly in the field,
particularly if most users are on the 64-bit version.

> Does this problem occurs only under Linux 3.9 kernel (and not under
> Linux <= 3.8 kernel versions) ?

Uh, no.  I first saw it on my overdue-for-upgrade F16 machine,
running kernel-3.6.11-4.fc16.x86_64.  I thought maybe it was a old
bug, but it's still there in F19.

			regards, tom lane


More information about the devel mailing list