Re: Odd 9.4, 9.3 buildfarm failure on s390x

From: Larry Rosenman <ler(at)lerctr(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>, Mark Wong <mark(at)2ndquadrant(dot)com>, Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>, Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Odd 9.4, 9.3 buildfarm failure on s390x
Date: 2018-10-01 21:15:01
Message-ID: 20181001211500.gvrfkjthapyyvnk4@ler-imac.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Oct 01, 2018 at 05:11:02PM -0400, Tom Lane wrote:
> Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com> writes:
> > On 10/01/2018 11:58 AM, Tom Lane wrote:
> >> Oooh ... apparently, on that platform, memcmp() is willing to produce
> >> INT_MIN in some cases. That's not a safe value for a sort comparator
> >> to produce --- we explicitly say that somewhere, IIRC. I think we
> >> implement DESC by negating the comparator's result, which explains
> >> why only the DESC case fails.
>
> > Is there a standard that forbids this, or have we just been lucky up to now?
>
> We've been lucky; POSIX just says the value is less than, equal to,
> or greater than zero.
>
> In practice, a memcmp that operates byte-at-a-time would not likely
> return anything outside +-255. But on a big-endian machine you could
> easily optimize to use word-wide operations to compare 4 bytes at a
> time, and I suspect that's what's happening here. Or maybe there's
> just some weird architecture-specific reason that makes it cheap
> for them to return INT_MIN rather than some other value?
>
as a former S3[79]x assembler programmer, they probably do it in
registers or using TRT. All of which could be word wise.

> regards, tom lane
>

--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 214-642-9640 E-Mail: ler(at)lerctr(dot)org
US Mail: 5708 Sabbia Drive, Round Rock, TX 78665-2106

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-10-01 21:25:40 Re: executor relation handling
Previous Message Stephen Frost 2018-10-01 21:11:41 Re: has_column_privilege behavior (was Re: Assert failed in snprintf.c)