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

Bug#687545: marked as done (libc6: Incorrect decimal printf output of tiny long double values on PowerPC)



Your message dated Thu, 17 Dec 2015 19:47:53 +0100
with message-id <20151217184753.GA17349@aurel32.net>
and subject line Re: Bug#687545: libc6: Incorrect decimal printf output of tiny long double values on PowerPC
has caused the Debian Bug report #687545,
regarding libc6: Incorrect decimal printf output of tiny long double values on PowerPC
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
687545: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=687545
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: libc6
Version: 2.13-35
Severity: normal

The minimum positive long double value is not output correctly by
printf with the decimal conversion specifiers (e, f, g) on PowerPC
(where long double is implemented with a double-double arithmetic).
See the testcase below. There may be the same problem with other
tiny values.

#include <stdio.h>
#include <math.h>

int main (void)
{
  double d;
  long double e;

  d = nextafter (0.0, 1.0);
  printf ("d = %e = %f = %g = %a\n", d, d, d, d);
  e = d;
  printf ("e = %Le = %Lf = %Lg = %La\n", e, e, e, e);
  d = e;
  printf ("d = %e = %f = %g = %a\n", d, d, d, d);
  printf ("d = %.330f\n", d);
  printf ("e = %.330Lf\n", e);
  return 0;
}

I get:

d = 4.940656e-324 = 0.000000 = 4.94066e-324 = 0x0.0000000000001p-1022
e = 4.450148e-308 = 0.000000 = 4.45015e-308 = 0x0.0000000000001p-1022
d = 4.940656e-324 = 0.000000 = 4.94066e-324 = 0x0.0000000000001p-1022
d = 0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004940656
e = 0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044501477170144027661805

Note that 4.450148e-308 / 4.940656e-324 is about 2^53, where 53 is the
precision of a double. I suspect that the glibc code doesn't handle
small values such that one of the double's in the representation is 0.

-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (900, 'testing'), (900, 'stable'), (200, 'unstable')
Architecture: powerpc (ppc)

Kernel: Linux 2.6.26-1-powerpc
Locale: LANG=POSIX, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages libc6 depends on:
ii  libc-bin  2.13-35
ii  libgcc1   1:4.7.1-7

libc6 recommends no packages.

Versions of packages libc6 suggests:
ii  debconf [debconf-2.0]  1.5.46
pn  glibc-doc              <none>
ii  locales                2.13-35

-- debconf information:
  glibc/upgrade: true
  glibc/disable-screensaver:
* glibc/restart-failed:
* glibc/restart-services: spamassassin openbsd-inetd exim4 cron atd
* libraries/restart-without-asking: true

-- debsums errors found:
dpkg-query: warning: parsing file '/var/lib/dpkg/status' near line 5250 package 'inn2':
 missing architecture
dpkg-query: warning: parsing file '/var/lib/dpkg/status' near line 8462 package 'libgdbmg1':
 missing architecture
dpkg-query: warning: parsing file '/var/lib/dpkg/status' near line 11058 package 'libnewt0':
 missing architecture
dpkg-query: warning: parsing file '/var/lib/dpkg/status' near line 13393 package 'docbook-mathml':
 missing architecture
dpkg-query: warning: parsing file '/var/lib/dpkg/status' near line 22784 package 'libpcd':
 missing architecture
dpkg-query: warning: parsing file '/var/lib/dpkg/status' near line 31190 package 'inn2-inews':
 missing architecture
dpkg-query: warning: parsing file '/var/lib/dpkg/status' near line 33324 package 'libisc4':
 missing architecture
dpkg-divert: warning: parsing file '/var/lib/dpkg/status' near line 5250 package 'inn2':
 missing architecture
dpkg-divert: warning: parsing file '/var/lib/dpkg/status' near line 8462 package 'libgdbmg1':
 missing architecture
dpkg-divert: warning: parsing file '/var/lib/dpkg/status' near line 11058 package 'libnewt0':
 missing architecture
dpkg-divert: warning: parsing file '/var/lib/dpkg/status' near line 13393 package 'docbook-mathml':
 missing architecture
dpkg-divert: warning: parsing file '/var/lib/dpkg/status' near line 22784 package 'libpcd':
 missing architecture
dpkg-divert: warning: parsing file '/var/lib/dpkg/status' near line 31190 package 'inn2-inews':
 missing architecture
dpkg-divert: warning: parsing file '/var/lib/dpkg/status' near line 33324 package 'libisc4':
 missing architecture

--- End Message ---
--- Begin Message ---
Version: 2.19-18

On 2012-09-13 18:29, Vincent Lefevre wrote:
> Package: libc6
> Version: 2.13-35
> Severity: normal
> 
> The minimum positive long double value is not output correctly by
> printf with the decimal conversion specifiers (e, f, g) on PowerPC
> (where long double is implemented with a double-double arithmetic).
> See the testcase below. There may be the same problem with other
> tiny values.
> 
> #include <stdio.h>
> #include <math.h>
> 
> int main (void)
> {
>   double d;
>   long double e;
> 
>   d = nextafter (0.0, 1.0);
>   printf ("d = %e = %f = %g = %a\n", d, d, d, d);
>   e = d;
>   printf ("e = %Le = %Lf = %Lg = %La\n", e, e, e, e);
>   d = e;
>   printf ("d = %e = %f = %g = %a\n", d, d, d, d);
>   printf ("d = %.330f\n", d);
>   printf ("e = %.330Lf\n", e);
>   return 0;
> }
> 
> I get:
> 
> d = 4.940656e-324 = 0.000000 = 4.94066e-324 = 0x0.0000000000001p-1022
> e = 4.450148e-308 = 0.000000 = 4.45015e-308 = 0x0.0000000000001p-1022
> d = 4.940656e-324 = 0.000000 = 4.94066e-324 = 0x0.0000000000001p-1022
> d = 0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004940656
> e = 0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044501477170144027661805
> 
> Note that 4.450148e-308 / 4.940656e-324 is about 2^53, where 53 is the
> precision of a double. I suspect that the glibc code doesn't handle
> small values such that one of the double's in the representation is 0.

This bug is reproducible in wheezy but not in jessie. I therefore
conclude that the bug has been fixed in between and I am closing it with
this mail.

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurelien@aurel32.net                 http://www.aurel32.net

--- End Message ---

Reply to: