bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: HP-UX 10.20 format failure (was: snapshot 3 in preparation for 1.4.


From: Gary V. Vaughan
Subject: Re: HP-UX 10.20 format failure (was: snapshot 3 in preparation for 1.4.13)
Date: Wed, 25 Feb 2009 16:10:44 +0700

Hi Eric,

2009/2/24 Eric Blake <address@hidden>:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> According to Gary V. Vaughan on 2/23/2009 7:39 PM:
>> hppa2.0-hp-hpux10.20-hpc1037  m4 fails: 175.format
>> Checking ./175.format
>> @ ../doc/m4.texinfo:5978: Origin of test
>> ./175.format: stdout mismatch
>> *** m4-tmp.11726/m4-xout        Mon Feb 23 21:34:51 2009
>> --- m4-tmp.11726/m4-out Mon Feb 23 21:34:51 2009
>> ***************
>> *** 3,8 ****
>>   1
>>   56790
>>   5000
>> ! success
>>   success
>>   20
>> --- 3,8 ----
>>   1
>>   56790
>>   5000
>> ! 17976931348623157100000...
>
> Ouch - it looks like this platform parsed "inf" as a huge value, then
> printed it as a finite value rather than infinity.  I can't tell whether
> the strtod misparsed inf, or whether it gave a valid infinite value which
> was then mishandled by isinf().  Can you run 'make -k check' to see if it
> at least passes gnulib tests?

All pass except this one:

...
cc  -I. -I../lib  -I. -I. -I.. -I./.. -I../lib -I./../lib -I../intl
+O2 -Ae -z +Ofltacc +ESlit +DAportable +Oentrysched +Odataprefetch
+Onolimit -c test-vasprintf-posix.c
cc: "test-vasprintf-posix.c", line 231: warning 548: Floating division by zero.
cc: "test-vasprintf-posix.c", line 241: warning 548: Floating division by zero.
cc: "test-vasprintf-posix.c", line 251: warning 548: Floating division by zero.
cc: "test-vasprintf-posix.c", line 472: warning 548: Floating division by zero.
cc: "test-vasprintf-posix.c", line 484: warning 548: Floating division by zero.
cc: "test-vasprintf-posix.c", line 545: warning 548: Floating division by zero.
cc: "test-vasprintf-posix.c", line 555: warning 548: Floating division by zero.
cc: "test-vasprintf-posix.c", line 565: warning 548: Floating division by zero.
cc: "test-vasprintf-posix.c", line 888: warning 548: Floating division by zero.
cc: "test-vasprintf-posix.c", line 900: warning 548: Floating division by zero.
cc: "test-vasprintf-posix.c", line 1058: warning 548: Floating division by zero.
cc: "test-vasprintf-posix.c", line 1069: warning 548: Floating division by zero.
cc: "test-vasprintf-posix.c", line 1080: warning 548: Floating division by zero.
cc: "test-vasprintf-posix.c", line 1162: warning 548: Floating division by zero.
cc: "test-vasprintf-posix.c", line 1173: warning 548: Floating division by zero.
cc: "test-vasprintf-posix.c", line 1357: warning 548: Floating division by zero.
cc: "test-vasprintf-posix.c", line 1368: warning 548: Floating division by zero.
cc: "test-vasprintf-posix.c", line 1379: warning 548: Floating division by zero.
cc: "test-vasprintf-posix.c", line 1562: warning 548: Floating division by zero.
cc: "test-vasprintf-posix.c", line 1573: warning 548: Floating division by zero.
cc: "test-vasprintf-posix.c", line 1668: warning 548: Floating division by zero.
cc: "test-vasprintf-posix.c", line 1679: warning 548: Floating division by zero.
cc: "test-vasprintf-posix.c", line 1690: warning 548: Floating division by zero.
cc: "test-vasprintf-posix.c", line 1712: warning 548: Floating division by zero.
cc: "test-vasprintf-posix.c", line 1804: warning 548: Floating division by zero.
cc: "test-vasprintf-posix.c", line 1815: warning 548: Floating division by zero.
cc: "test-vasprintf-posix.c", line 1826: warning 548: Floating division by zero.
cc: "test-vasprintf-posix.c", line 1848: warning 548: Floating division by zero.
cc: "test-vasprintf-posix.c", line 2046: warning 548: Floating division by zero.
cc: "test-vasprintf-posix.c", line 2057: warning 548: Floating division by zero.
cc: "test-vasprintf-posix.c", line 2068: warning 548: Floating division by zero.
cc: "test-vasprintf-posix.c", line 2168: warning 548: Floating division by zero.
cc: "test-vasprintf-posix.c", line 2179: warning 548: Floating division by zero.
cc: "test-vasprintf-posix.c", line 2379: warning 548: Floating division by zero.
cc: "test-vasprintf-posix.c", line 2390: warning 548: Floating division by zero.
cc: "test-vasprintf-posix.c", line 2401: warning 548: Floating division by zero.
cc: "test-vasprintf-posix.c", line 2602: warning 548: Floating division by zero.
cc: "test-vasprintf-posix.c", line 2613: warning 548: Floating division by zero.
cc: "test-vasprintf-posix.c", line 2812: warning 548: Floating division by zero.
cc: "test-vasprintf-posix.c", line 2823: warning 548: Floating division by zero.
cc: "test-vasprintf-posix.c", line 2834: warning 548: Floating division by zero.
cc: "test-vasprintf-posix.c", line 2927: warning 548: Floating division by zero.
cc: "test-vasprintf-posix.c", line 2938: warning 548: Floating division by zero.
cc: "test-vasprintf-posix.c", line 3133: warning 548: Floating division by zero.
cc: "test-vasprintf-posix.c", line 3144: warning 548: Floating division by zero.
cc: "test-vasprintf-posix.c", line 3155: warning 548: Floating division by zero.
cc: "test-vasprintf-posix.c", line 3349: warning 548: Floating division by zero.
cc: "test-vasprintf-posix.c", line 3360: warning 548: Floating division by zero.
...
test-vasprintf-posix.c:2804: assertion failed
/opt/fsw/bash32/bin/bash: line 1: 13245 ABORT instruction       (core
dumped) EXEEXT='' EXEEXT='' LOCALE_FR='fr_FR.iso88591'
LOCALE_FR_UTF8='none' EXEEXT='' LIBSIGSEGV='' EXEEXT='' EXEEXT=''
srcdir='.' EXEEXT='' EXEEXT='' srcdir='.' EXEEXT='' srcdir='.'
EXEEXT='' srcdir='.' EXEEXT='' srcdir='.' EXEEXT=''
LOCALE_FR='fr_FR.iso88591' LOCALE_FR_UTF8='none' LOCALE_JA='none'
LOCALE_ZH_CN='none' EXEEXT='' LOCALE_FR_UTF8='none' EXEEXT=''
srcdir='.' LOCALE_FR='fr_FR.iso88591' LOCALE_FR_UTF8='none' EXEEXT=''
LOCALE_FR='fr_FR.iso88591' LOCALE_FR_UTF8='none' LOCALE_JA='none'
LOCALE_ZH_CN='none' ${dir}$tst
FAIL: test-vasprintf-posix

> Can you run any further debugging on your
> side, to see if you can spot where 'format(%010F,infinity)' starts
> treating the value as a finite?

With the following short program, using the system strtod:

#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
int main (int argc, char *argv[]) {
  double d;
  errno = 0;
  d = strtod(argv[1], NULL);
  if (errno) printf ("err %d: %s\n", errno, strerror (errno));
  if (d == +HUGE_VAL) printf ("+HUGE_VAL\n");
  else if (d == -HUGE_VAL) printf ("-HUGE_VAL\n");
  else if (d == 0.0) printf ("0.0\n");
  else printf ("%010f\n", d);
  return 0;
}

% cc -Ae +DAportable -o foo foo.c
% ./foo 1.23
001.230000
% ./foo 0.12
000.120000
% ./foo 0.0
0.0
% ./foo 9999999E999999
err 34: Result too large
+HUGE_VAL
% ./foo -9999999E999999
err 34: Result too large
-HUGE_VAL
% ./foo inf
0.0
% ./foo INF
0.0
% ./foo ink
0.0
% ./foo 0.12ink
000.120000

> Hmm, a closer look at POSIX makes it appear that on non-IEEE machines, it
> is feasible to not support infinity, in which case strtod("inf",NULL) must
> fail with ERANGE and a value of HUGE_VAL.  Does the hardware even support
> IEEE infinities?  If not, I need to correct the strtod tests to cater to
> hardware that lacks infinity.

The manpage for strtod says:

      strtod() returns, as a double-precision floating-point number, the
      value represented by the character string pointed to by str.  The
      string is scanned (leading white-space characters as defined by
      isspace() in ctype(3C) are ignored) up to the first unrecognized
      character.  If no conversion can take place, zero is returned.

      If the correct value would cause overflow, +HUGE_VAL or -HUGE_VAL is
      returned (according to the sign of the value), and errno is set to
      ERANGE.

      If the correct value would cause underflow, zero is returned and errno
      is set to ERANGE.

Which explains the results above.  How do I tell whether the hardware
can support IEEE infinity?  It certainly looks as though the system
strtod doesn't understand "inf" in the way we're expecting...

HTH,
    Gary
-- 
Email me:          address@hidden                        (\(\
Read my blog:      http://blog.azazil.net              ( o.O)
And my other blog: http://www.machaxor.net              (uu )o
...and my book:    http://sources.redhat.com/autobook  ("("_)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]