bug-gnulib
[Top][All Lists]
Advanced

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

Re: "seq .1 .1" would mistakenly generate no output on FreeBSD 6.1


From: Jim Meyering
Subject: Re: "seq .1 .1" would mistakenly generate no output on FreeBSD 6.1
Date: Tue, 20 Nov 2007 18:03:01 +0100

Paul Eggert <address@hidden> wrote:
...
> I looked at the revised print_numbers function and found what I think
> is one or two other instances of similar problems.  I hope the
> following code will have a better chance of surviving similar problems
> in the future.  (The proposed code is a tad shorter and avoids some
> code duplication and IF_LINT stuff; that's a good sign...)
>
> 2007-11-18  Paul Eggert  <address@hidden>
>
>       * src/seq.c (print_numbers): Rewrite in an attempt to avoid the
>       more-general rounding issues exposed by the previous patch.

It looked ok, so I built and ran tests on freebsd6.1.
Unfortunately, it provokes several new failures:

  Abort trap (core dumped)
  -: test float-1 failed: exit status mismatch:  expected 0, got 134
  Abort trap (core dumped)
  -: test float-5 failed: exit status mismatch:  expected 0, got 134
  Abort trap (core dumped)
  -: test float-6 failed: exit status mismatch:  expected 0, got 134
  Abort trap (core dumped)
  -: test wid-1 failed: exit status mismatch:  expected 0, got 134
  Abort trap (core dumped)
  -: test wid-2 failed: exit status mismatch:  expected 0, got 134
  Abort trap (core dumped)
  -: test eq-wid-4 failed: exit status mismatch:  expected 0, got 134

It seems to have exposed a problem in gnulib's vasnprintf.c:

  freebsd6$ gdb --args ./seq 0.8 0.1 0.9
  GNU gdb 6.6
  (gdb) r
  Starting program: /tmp/coreutils-6.9.89.27-a9805-dirty/src/seq 0.8 0.1 0.9
  0.8
  Program received signal SIGABRT, Aborted.
  0x28136363 in kill () from /lib/libc.so.6
  (gdb) up
  #1  0x28136300 in raise () from /lib/libc.so.6
  (gdb)
  #2  0x28135014 in abort () from /lib/libc.so.6
  (gdb)
  #3  0x0804d8f1 in decode_long_double (x=0.80000000000000000001084202172485504,
      ep=0xbfbfe1e0, mp=0xbfbfe1d8) at vasnprintf.c:877
  877         abort ();
  (gdb) l
  872           if (!(y >= 0.0L && y < 1.0L))
  873             abort ();
  874           m.limbs[--i] = (hi << (GMP_LIMB_BITS / 2)) | lo;
  875         }
  876       if (!(y == 0.0L))
  877         abort ();
  878       /* Normalise.  */
  879       while (m.nlimbs > 0 && m.limbs[m.nlimbs - 1] == 0)
  880         m.nlimbs--;
  881       *mp = m;
  (gdb) p y
  $1 = 0.60009765625
  (gdb) p ep
  $2 = (int *) 0xbfbfe1e0
  (gdb) p *ep
  $3 = -858993460
  (gdb) up
  #4  0x0804e3ca in scale10_round_decimal_long_double (
      x=0.80000000000000000001084202172485504, n=1) at vasnprintf.c:1205
  1205      void *memory = decode_long_double (x, &e, &m);
  (gdb) p x
  $4 = 0.80000000000000000001084202172485504
  (gdb) dow
  #3  0x0804d8f1 in decode_long_double (x=0.80000000000000000001084202172485504,
      ep=0xbfbfe1e0, mp=0xbfbfe1d8) at vasnprintf.c:877
  877         abort ();
  (gdb) l
  872           if (!(y >= 0.0L && y < 1.0L))
  873             abort ();
  874           m.limbs[--i] = (hi << (GMP_LIMB_BITS / 2)) | lo;
  875         }
  876       if (!(y == 0.0L))
  877         abort ();
  878       /* Normalise.  */
  879       while (m.nlimbs > 0 && m.limbs[m.nlimbs - 1] == 0)
  880         m.nlimbs--;
  881       *mp = m;
  (gdb) p m
  $5 = {
    nlimbs = 2,
    limbs = 0x805c050
  }
  (gdb) p *(m.limbs)@m.nlimbs
  $6 = {2576980377, 1677721}




reply via email to

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