Re: [HACKERS] Regression tests on intel for 6.5.2 - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Regression tests on intel for 6.5.2
Date
Msg-id 28004.938476013@sss.pgh.pa.us
Whole thread Raw
In response to Regression tests on intel for 6.5.2  (Lamar Owen <lamar.owen@wgcr.org>)
List pgsql-hackers
Lamar Owen <lamar.owen@wgcr.org> writes:
> In the course of building and testing the rpm's for 6.5.2, unexpected
> results were found in the regression testing.  I am curious as to what
> the results for 'float8' mean (geometry also failed, but it's obvious as
> to why):

I saw similar results with older Postgres releases on HPUX.  The problem
is failure to detect an invalid result from the exp() library function.
Unfortunately there's not complete uniformity about how to test that
on different platforms.

What's currently in dexp() in backend/utils/adt/float.c is

#ifndef finite
    errno = 0;
#endif
    *result = (float64data) exp(tmp);
#ifndef finite
    if (errno == ERANGE)
#else
    /* infinity implies overflow, zero implies underflow */
    if (!finite(*result) || *result == 0.0)
#endif
        elog(ERROR, "exp() result is out of range");

which is evidently doing the wrong thing on your platform.  What does
your man page for exp() say about error return conventions?

I suspect the assumption that finite() is always implemented as a macro
if it's present at all is the weak spot ... or it might be that your
math lib returns some other error code like EDOM ...

            regards, tom lane


pgsql-hackers by date:

Previous
From: Lamar Owen
Date:
Subject: Re: [HACKERS] Re: New init script and upgrade attempt: failed
Next
From: "Hiroshi Inoue"
Date:
Subject: RE: [HACKERS] Re: IPC on win32 - additions for 6.5.2 and current trees