Re: Odd 9.4, 9.3 buildfarm failure on s390x

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Odd 9.4, 9.3 buildfarm failure on s390x
Дата
Msg-id 29380.1538428262@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Odd 9.4, 9.3 buildfarm failure on s390x  (Andrew Dunstan <andrew.dunstan@2ndquadrant.com>)
Ответы Re: Odd 9.4, 9.3 buildfarm failure on s390x
Список pgsql-hackers
Andrew Dunstan <andrew.dunstan@2ndquadrant.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?

            regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: Odd 9.4, 9.3 buildfarm failure on s390x
Следующее
От: Stephen Frost
Дата:
Сообщение: Re: has_column_privilege behavior (was Re: Assert failed insnprintf.c)