Re: PostgreSQL 11 beta1 on AIX 7.2 : 2 failures in 32bit mode

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Noah Misch <noah(at)leadboat(dot)com>
Cc: "REIX, Tony" <tony(dot)reix(at)atos(dot)net>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, "APEKE, SENA (ext)" <sena(dot)apeke(dot)external(at)atos(dot)net>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Anthony Bykov <a(dot)bykov(at)postgrespro(dot)ru>
Subject: Re: PostgreSQL 11 beta1 on AIX 7.2 : 2 failures in 32bit mode
Date: 2018-05-31 23:23:57
Message-ID: 6060.1527809037@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Noah Misch <noah(at)leadboat(dot)com> writes:
> On Thu, May 31, 2018 at 10:28:12AM -0400, Tom Lane wrote:
>> I wondered why the existing 32-bit AIX buildfarm machines aren't showing
>> problems, but looking closer at them, they are manually forcing
>> _LARGE_FILES, which probably is masking things:
>> 'config_env' => {
>> 'CC' => 'wrap-gcc -D_THREAD_SAFE=1 -D_LARGE_FILES=1 -maix32',
>> Noah, why'd you do that, and would you be willing to remove it? IMO
>> Postgres should work without that.

> I did that to work around a problem like the one articulated upthread.
> Specifically, a 64-bit build w/ plpython failed:
> ...
> Today's "configure" test concludes that we don't need _LARGE_FILES, because
> off_t is 64-bit ("long", specifically) in this configuration. The trouble
> arises when Python.h does cause _LARGE_FILES to be defined.

Ugh. That's a pretty crummy decision on their part, although maybe there
was no better alternative.

This does not seem like it explains Tony's problem with AIX 32-bit,
though, as you'd think all concerned would agree _LARGE_FILES needs
to be 1 in that case.

> At the time I added the workaround, I scratched down these candidates for a
> proper fix:

> 1. Add "configure" test to determine whether Python defines _LARGE_FILES.
> When it does, define it ourselves at the top of each Python-associated
> source file.

That would make aspects of our extension ABI dependent on whether one had
configured with --enable-python, which would be surprising to say the
least.

> 2. Define _LARGE_FILES unconditionally on AIX. That is, adopt the workaround
> as permanent.

Perhaps. I wonder though whether this is really an AIX-only problem.
(In particular, I wonder whether Python.h is clobbering _FILE_OFFSET_BITS
on other platforms.) There's a comment in Autoconf's AC_SYS_LARGEFILE
that suggests it is, but ...

> 3. Define _LARGE_FILES unconditionally. This should be harmless, but I
> wouldn't tend to back-patch it.

It seems like variants of this issue should exist in all branches,
so I'm not really happy with taking a fix we're scared to back-patch.
If we were willing to do so, though, this might be OK. Seems like there
are three possibilities:
* Defining _LARGE_FILES does something good, in which case we want it.
* Defining _LARGE_FILES does nothing.
* Defining _LARGE_FILES does something bad ... but it's hard to see
how that could be.

> 4. Include system headers that react to _LARGE_FILES before including
> Python.h. This is fragile; the list of affected headers may change.

Yeah, that seems fairly unworkable, though I wonder whether the
include-ordering advice in plpython.h isn't basically meant to achieve
this result.

We're still left with the question of why Tony is having a problem.
I wonder whether his build of Python.h is doing something strange
with _LARGE_FILES.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Noah Misch 2018-06-01 00:06:37 Re: PostgreSQL 11 beta1 on AIX 7.2 : 2 failures in 32bit mode
Previous Message Noah Misch 2018-05-31 22:41:29 Re: PostgreSQL 11 beta1 on AIX 7.2 : 2 failures in 32bit mode