Re: float8 regression failure (HEAD, cygwin) - Mailing list pgsql-hackers

From Reini Urban
Subject Re: float8 regression failure (HEAD, cygwin)
Date
Msg-id 44BF2FF5.1070309@x-ray.at
Whole thread Raw
In response to float8 regression failure (HEAD, cygwin)  ("Adrian Maier" <adrian.maier@gmail.com>)
Responses Re: float8 regression failure (HEAD, cygwin)  ("Adrian Maier" <adrian.maier@gmail.com>)
Re: float8 regression failure (HEAD, cygwin)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Adrian Maier schrieb:
> Hello,
> 
> While setting up a buildfarm installation for cygwin,  I've
> uncountered the following
> regression failure :
> 
>     float8               ... FAILED
> 
> ================== pgsql.3132/src/test/regress/regression.diffs
> *** ./expected/float8-small-is-zero.out    Tue Jul 18 09:24:52 2006
> --- ./results/float8.out    Tue Jul 18 09:53:42 2006
> ***************
> *** 13,29 ****
>  SELECT '-10e400'::float8;
>  ERROR:  "-10e400" is out of range for type double precision
>  SELECT '10e-400'::float8;
> !  float8
> ! --------
> !      0
> ! (1 row)
> !
>  SELECT '-10e-400'::float8;
> !  float8
> ! --------
> !     -0
> ! (1 row)
> !
>  -- bad input
>  INSERT INTO FLOAT8_TBL(f1) VALUES ('');
>  ERROR:  invalid input syntax for type double precision: ""
> --- 13,21 ----
>  SELECT '-10e400'::float8;
>  ERROR:  "-10e400" is out of range for type double precision
>  SELECT '10e-400'::float8;
> ! ERROR:  "10e-400" is out of range for type double precision
>  SELECT '-10e-400'::float8;
> ! ERROR:  "-10e-400" is out of range for type double precision
>  -- bad input
>  INSERT INTO FLOAT8_TBL(f1) VALUES ('');
>  ERROR:  invalid input syntax for type double precision: ""
> ***************
> *** 377,383 ****
> --- 369,377 ----
>  INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400');
>  ERROR:  "-10e400" is out of range for type double precision
>  INSERT INTO FLOAT8_TBL(f1) VALUES ('10e-400');
> + ERROR:  "10e-400" is out of range for type double precision
>  INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e-400');
> + ERROR:  "-10e-400" is out of range for type double precision
>  -- maintain external table consistency across platforms
>  -- delete all values and reinsert well-behaved ones
>  DELETE FROM FLOAT8_TBL;
> =========================================
> 
> This happening on cygwin 1.5.20 (running on top of winXP),   gcc 3.4.4.
> 
> 
> The entire check.log can be found here :
>    http://www.newsoftcontrol.ro/~am/pgfarm/check.log
> The other logs generated by the buildfarm can be found here:
>   http://www.newsoftcontrol.ro/~am/pgfarm/

Thanks,
Which postgresql version?
Can we have a regular cygwin error report please mailed to cygwin at 
cygwin.com please. See http://cygwin.com/problems.html (cygcheck -s -v 
-r > cygcheck.out)

Looks like a strtod() newlib feature, but I haven't inspected closely.
http://sources.redhat.com/ml/newlib/2006/msg00020.html

BTW: HAVE_LONG_LONG_INT_64 is defined, so INT64_IS_BUSTED is defined also.

Does it look the same on redhat fedora?
Our buildfarm doesn't have these issues,
this runs gcc-3.3.3 and gcc-3.4.4

The problem I see is that float8in() in
src/backend/utils/adt/float.c checks only for "-Infinity" and not "-inf" 
as returned by newlib:  pg_strncasecmp(num, "-Infinity", 9) == 0

Can you test this?
$ cat test-strtod.c
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <float.h>

double d;
char *tail;

int main() {    errno = 0;    d = strtod("-10e400", &tail);    printf("double: %f, errno: %d, tail: '%s', isinf: %d,
fabs:%f, 
 
inf>max: %d" ,   d, errno, tail, isinf(d), fabs(d), fabs(d) > DBL_MAX ? 1 : 0);
}

$ gcc test-strtod.c; ./a
double: -inf, errno: 34, tail: '', isinf: 1, fabs: inf, inf>max: 1
-- 
Reini Urban - postgresql-cygwin maintainer
http://phpwiki.org/  http://murbreak.at/
http://helsinki.at/  http://spacemovie.mur.at/


pgsql-hackers by date:

Previous
From: "Hiroshi Saito"
Date:
Subject: Re: pg_regress breaks on msys
Next
From: "Adrian Maier"
Date:
Subject: Re: float8 regression failure (HEAD, cygwin)