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

Bug#442568: marked as done (glibc: floor() is giving incorrect results on alpha architecture)



Your message dated Fri, 23 Nov 2007 19:32:05 +0000
with message-id <E1IveFx-0004Xf-63@ries.debian.org>
and subject line Bug#442568: fixed in glibc 2.7-1
has caused the attached Bug report 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 I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--- Begin Message ---
Package: glibc
Severity: normal

Consider the following code

$cat double_comparison.c
#include <assert.h>
#include <float.h>
#include <math.h>
#include <stdio.h>

int main() {
  double x;

  printf("%s%d\n", "DBL_MANT_DIG = ", DBL_MANT_DIG);
  x = ldexp (1.0, DBL_MANT_DIG) - 1.0;
  printf("%lf %lf\n", x, floor(x));
  assert(x == floor(x));    /* does not seem to work in alpha */
  return 0;
}

On i386 machine
$gcc -Wall double_comparison.c -lm

$./a.out
DBL_MANT_DIG = 53
9007199254740991.000000 9007199254740991.000000

However the assertion fails on alpha architecture because the value is
9007199254740991.000000 and the floor gives 9007199254740990.000000

This behaviour makes guile-1.8 (version 1.8.2+1-2) FTBFS on alpha architecture.
The corresponding build log can be found at
http://buildd.debian.org/fetch.cgi?&pkg=guile-1.8&ver=1.8.2%2B1-2&arch=alpha&stamp=1188100514&file=log

>From guile-1.8-1.8.2+1/test-suite/standalone/test-round.c the lines where the
guile-1.8 build fails is 

      /* 2^DBL_MANT_DIG-1
         In the past scm_c_round had incorrectly incremented this value, due
         to the way that x+0.5 would round upwards (in the usual default
         nearest-even mode on most systems).  */
      x = ldexp (1.0, DBL_MANT_DIG) - 1.0;
      assert (x == floor (x));      /* should be an integer already */
      assert (scm_c_round (x) == x);  /* scm_c_round should return it unchanged */

Initially I asked about this problem on debian-devel. Steve Langasek mentioned
that this is a bug in glibc. So I am filing it here. The discussion can be
found at http://lists.debian.org/debian-devel/2007/09/msg00536.html

PS: the double_comparison.c test case is written by me and has not been tested
on alpha. Please change it accordingly if there are any problems with it.


thanks
raju

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.22-2-686 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash



--- End Message ---
--- Begin Message ---
Source: glibc
Source-Version: 2.7-1

We believe that the bug you reported is fixed in the latest version of
glibc, which is due to be installed in the Debian FTP archive:

glibc-doc_2.7-1_all.deb
  to pool/main/g/glibc/glibc-doc_2.7-1_all.deb
glibc_2.7-1.diff.gz
  to pool/main/g/glibc/glibc_2.7-1.diff.gz
glibc_2.7-1.dsc
  to pool/main/g/glibc/glibc_2.7-1.dsc
libc6-dbg_2.7-1_amd64.deb
  to pool/main/g/glibc/libc6-dbg_2.7-1_amd64.deb
libc6-dev-i386_2.7-1_amd64.deb
  to pool/main/g/glibc/libc6-dev-i386_2.7-1_amd64.deb
libc6-dev_2.7-1_amd64.deb
  to pool/main/g/glibc/libc6-dev_2.7-1_amd64.deb
libc6-i386_2.7-1_amd64.deb
  to pool/main/g/glibc/libc6-i386_2.7-1_amd64.deb
libc6-pic_2.7-1_amd64.deb
  to pool/main/g/glibc/libc6-pic_2.7-1_amd64.deb
libc6-prof_2.7-1_amd64.deb
  to pool/main/g/glibc/libc6-prof_2.7-1_amd64.deb
libc6-udeb_2.7-1_amd64.udeb
  to pool/main/g/glibc/libc6-udeb_2.7-1_amd64.udeb
libc6_2.7-1_amd64.deb
  to pool/main/g/glibc/libc6_2.7-1_amd64.deb
libnss-dns-udeb_2.7-1_amd64.udeb
  to pool/main/g/glibc/libnss-dns-udeb_2.7-1_amd64.udeb
libnss-files-udeb_2.7-1_amd64.udeb
  to pool/main/g/glibc/libnss-files-udeb_2.7-1_amd64.udeb
locales-all_2.7-1_amd64.deb
  to pool/main/g/glibc/locales-all_2.7-1_amd64.deb
locales_2.7-1_all.deb
  to pool/main/g/glibc/locales_2.7-1_all.deb
nscd_2.7-1_amd64.deb
  to pool/main/g/glibc/nscd_2.7-1_amd64.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 442568@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Aurelien Jarno <aurel32@debian.org> (supplier of updated glibc package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Fri, 23 Nov 2007 10:46:24 +0100
Source: glibc
Binary: libc0.1-prof libc6.1-alphaev67 libc6-dev-amd64 locales-all libc6-i686 libc6-dev-ppc64 libc0.3-pic glibc-doc libc0.3 libc6-dev-mipsn32 libc0.1-i686 libc0.1-i386 libc6-mips64 libc6.1-dev libc6-s390x libnss-files-udeb libc0.1-dev-i386 libc6-dev-sparc64 libc6-i386 libc0.3-dev libc6-udeb libc6-dbg libc6.1-pic libc6-dev libc0.3-prof libc0.1-udeb libc6-dev-i386 libc6.1-prof libc6-mipsn32 libc0.1-dev locales libc6-pic libc0.3-udeb libc6-dev-powerpc libc0.1-pic libc6-ppc64 libc0.3-dbg libc0.1-dbg libc6-amd64 libc0.1 libc6-prof libc6-xen libc6-dev-mips64 libc6-powerpc libc6 libc6-sparcv9b libc6.1-udeb libc6.1-dbg nscd libc6-sparc64 libnss-dns-udeb libc6.1 libc6-dev-s390x
Architecture: source amd64 all
Version: 2.7-1
Distribution: unstable
Urgency: low
Maintainer: Aurelien Jarno <aurel32@debian.org>
Changed-By: Aurelien Jarno <aurel32@debian.org>
Description: 
 glibc-doc  - GNU C Library: Documentation
 libc6      - GNU C Library: Shared libraries
 libc6-dbg  - GNU C Library: Libraries with debugging symbols
 libc6-dev  - GNU C Library: Development Libraries and Header Files
 libc6-dev-i386 - GNU C Library: 32bit development libraries for AMD64
 libc6-i386 - GNU C Library: 32bit shared libraries for AMD64
 libc6-pic  - GNU C Library: PIC archive library
 libc6-prof - GNU C Library: Profiling Libraries
 libc6-udeb - GNU C Library: Shared libraries - udeb (udeb)
 libnss-dns-udeb - GNU C Library: NSS helper for DNS - udeb (udeb)
 libnss-files-udeb - GNU C Library: NSS helper for files - udeb (udeb)
 locales    - GNU C Library: National Language (locale) data [support]
 locales-all - GNU C Library: Precompiled locale data
 nscd       - GNU C Library: Name Service Cache Daemon
Closes: 229251 442250 442568 443460 443660 444145 444580 445631 447221 447328 447866 447928 448248 448508 448723 448796 448928 449193 449198 451304 451958
Changes: 
 glibc (2.7-1) unstable; urgency=low
 .
   [ Clint Adams ]
   * New upstream release with linuxthreads snapshot.
     - Fixes an ABBA deadlock in ld.so.  Closes: #443460.
     - Render dgettext" thread safe.  Closes: #443660.
     - Fixes CVE-2007-4840 (multiple errors in iconv
       function).  Closes: #442250.
     - Fixes strtod("-0", 0).  Closes: #448723.
     - Remove localedata/locale-de_CH.diff (merged).
     - Update locale/fix-LC_COLLATE-rules.diff.
     - Update locale/LC_COLLATE-keywords-ordering.diff.
     - Update locale/fix-C-first_weekday.diff.
     - Update locale/preprocessor-collate.diff.
     - Update localedata/locales-fr.diff.
     - Remove localedata/locale-sa_IN.diff (merged).
     - Remove localedata/locale-wo_SN.diff (merged).
     - Update localedata/tailor-iso14651_t1.diff.
     - Add localedata/tailor-iso14651_t1-common.diff.
     - Remove localedata/fix-unknown-symbols.diff (merged).
     - Update localedata/first_weekday.diff.
     - Add localedata/cs_CZ-first_weekday.diff.
     - Add localedata/da_DK-first_weekday.diff.
     - Add localedata/pl_PL-first_weekday.diff.
     - Add localedata/de_DE-first_weekday.diff.
     - Add localedata/en_GB-first_weekday.diff.
     - Add localedata/en_US-first_weekday.diff.
     - Add localedata/et_EE-first_weekday.diff.
     - Add localedata/fr_BE-first_weekday.diff.
     - Add localedata/fr_CA-first_weekday.diff.
     - Add localedata/fr_CH-first_weekday.diff.
     - Add localedata/fr_FR-first_weekday.diff.
     - Add localedata/fr_LU-first_weekday.diff.
     - Add localedata/hu_HU-first_weekday.diff.
     - Add localedata/nb_NO-first_weekday.diff.
     - Add localedata/nn_NO-first_weekday.diff.
     - Add localedata/sk_SK-first_weekday.diff.
     - Add localedata/cy_GB-first_weekday.diff.
     - Update localedata/sort-UTF8-first.diff.
     - Remove localedata/submitted-as_IN.diff (merged).
     - Remove hppa/submitted-multiple-threads.diff (merged).
     - Remove hppa/submitted-ustat.diff (merged).
     - Remove hurd-i386/cvs-sigsuspend-nocancel.diff (merged).
     - Remove hurd-i386/cvs-lock-intern.diff (merged).
     - Remove sparc/local-undefined-registers.diff (obsolete).
     - Remove all/local-pt_BR.diff (merged).
     - Remove any/cvs-ld_library_path.diff (merged).
     - Remove any/cvs-initfini.diff (merged).
     - Remove any/cvs-posix-glob.diff (merged).
     - Update any/local-bashisms.diff.
     - Remove any/local-forward-backward-collation.diff (merged).
     - Remove any/local-version-sanity.diff (merged).
     - Remove any/submitted-strtok.diff (merged).
     - Remove any/submitted-regex-collate.diff (merged).
     - Remove localedata/locale-no_NO.diff (obsolete).
     - Update localedata/supported.diff.
   * Bump shlib version to 2.7-1.
   * Add localedata/cvs-locale-ig_NG.diff BZ#5224, missing collation symbols
     for ig_NG.
   * Add localedata/cvs-locale-lo_LA.diff BZ#5237, missing collation symbols
     for lo_LA.
   * Add localedata/cvs-locale-ug_CN.diff BZ#5238, missing collation symbols
     for ug_CN.
 .
   [ Aurelien Jarno ]
   * any/submitted-longdouble.diff: update.
   * Improve any/submitted-rfc3484-sortv4.diff.
   * Update hurd-i386/submitted-trivial.diff.
   * any/local-strfry.diff: new patch to fix strfry(), as Ulrich Drepper
     has still not managed to commit a correct version.
   * Remove hppa/submitted-threaddb.diff (merged).
   * Update hppa/submitted-nptl-carlos.diff.
   * Update hurd-i386/submitted-libc_once.diff.
   * Remove hurd-i386/cvs-ioctl-delay.diff (merged).
   * Update hurd-i386/local-tls-support.diff.
   * Add hurd-i386/cvs-kernel-features.diff: provide almost empty
     kernel-features.h for files that include it.
   * Add arm/local-args6.diff: provide DOCARGS_6 and UNDOCARGS_5 for
     arm old-abi.
   * Add arm/local-lowlevellock.diff: new patch to fix build on arm.
   * debian/rules, debian/rules.d/build.mk: allow per architecture
     TIMEOUTFACTOR.
   * sysdeps/arm.mk, sysdeps/armel.mk, sysdeps/hppa.mk, sysdeps/s390.mk,
     sysdeps/sh4.mk: define TIMEOUTFACTOR.
   * locales-depver: tighten locales dependencies.
   * any/local-disable-test-tgmath2.diff: new patch to disable test-tgmath2,
     which take too much resources during compilation.
   * Add hurd-i386/submitted-strtoul.diff: new patch to use
     __strtoul_internal() instead of strtoul() in internal functions.
   * Add hurd-i386/submitted-ptr-mangle.diff: new patch to define PTR_MANGLE
     and PTR_DEMANGLE.
   * Update Galician debconf translation, by Jacobo Tarrio.  Closes: #447928.
   * Update Dutch debconf translation, by Bart Cornelis.  Closes: #448928.
   * Add sh4/local-fpscr_values.diff and any/local-allocalim-header.diff
     from Arthur Loiret.  Closes: #448248.
   * Fix encoding of Japanese translation.  Closes: #447221.
   * Add any/submitted-sched_h.diff: new patch to define `__CPU_ALLOC_SIZE.
   * Add mips/local-setjmp.diff: new patch to fix g++ tests on mips/mipsel.
   * Add any/local-fhs-nscd.diff: move nscd directory to /var/cache/nscd from
     /var/db/nscd.  Closes: #449198.
   * debhelper.in/nscd.postrm: remove /var/cache/nscd on purge.  Closes:
     #449193.
   * script.in/kernelcheck.sh, sysdeps/alpha.mk: bump minimum kernel version to
     2.6.9 for alpha.
   * script.in/kernelcheck.sh, sysdeps/sh4.mk: bump minimum kernel version to
     2.6.11 for sh4.
   * debian/patches/arm/local-eabi-wchar.diff: new patch from Riku Voipio to
     fiw WCHAR_MIN and WCHAR_MAX definitions on armel.  Closes: #444580.
   * debian/po/zh_CN.po: update from LI Daobing. Closes: #447866.
   * debhelper.in/locales-all.postinst: trap exit signal and remove temporary
     directory.  Closes: #447328.
   * debhelper.in/libc.NEWS: mention that the tzconfig script has been replaced
     by the maintainer scripts of tzdata.  Closes: bug#448796.
   * patches/all/local-alias-et_EE.diff: switch estonian locales alias to
     ISO-8859-15.
   * patches/alpha/submitted-fpu-round.diff: restore the old version of
     ceil/floor/rint functions.  Closes: #442568.
   * patches/alpha/local-dl-procinfo.diff: new patch to add platform
     capabilities support on alpha.
   * Add an ev67 flavour on alpha:  Closes: #229251
     - control.in/opt: add libc6-alphaev67 packages.
     - sysdeps/alpha.mk: add a new pass for ev67 flavour.
   * debian/local/manpages/iconv.1: document //translit and //ignore
     options.  Closes: #451304.
   * debian/local/manpages/getent.1: document exit codes.  Closes:
     #445631.
   * debian/local/manpages/ld.so.8: document $ORIGIN, $PLATFORM and $LIB
     features.  Closes: #444145.
   * local/manpages/ldconfig.8: remove --force option from the manpage
     to be consistent with the binary.  Closes: #451958.
   * kfreebsd/local-sysdeps.diff: update to revision 2046 (from glibc-bsd).
 .
   [ Petr Salinger]
   * any/local-stdio-lock.diff: make _IO_*_lock linuxthreads compliant.
   * any/local-o_cloexec.diff: don't assume O_CLOEXEC is always defined.
   * any/local-linuxthreads-signals.diff: always use non-RT signal handler
     on GNU/kFreeBSD.
 .
   [ Pierre Habouzit ]
   * Remove any/local-iconv-fix-trampoline.diff (obsolete).
   * Remove any/submitted-strfry.diff (merged).
   * Update any/submitted-rfc3484-sortv4.diff.
   * Update localedata/*first_weekday.diff.
   * Remove localedata/fix-am_ET.diff (obsolete).
   * Add locale/preprocessor-collate-uli-sucks.diff to revert Ulrich's
     preprocessor that isn't enough for Debian.
   * Update patches/locale/preprocessor-collate.diff.
   * Add alpha/submitted-PTR_MANGLE.diff (Closes: #448508).
 .
   [ Samuel Thibault ]
   * hurd-i386/submitted-ptr-mangle.diff: Define PTR_MANGLE for assembly.
   * hurd-i386/cvs-O_CLOEXEC_fix.diff: New patch to fix conflicting O_CLOEXEC
     value.
Files: 
 2da108b23dcf1238aa3974eda87541fb 2072 libs required glibc_2.7-1.dsc
 8816fbab13a072c0ccef6640c9d20833 15386750 libs required glibc_2.7.orig.tar.gz
 f074fde7a2422ddb2d3c6eaab35b846f 670811 libs required glibc_2.7-1.diff.gz
 da0dd582f8c6cd74c56b4ec58b199b8f 1622856 doc optional glibc-doc_2.7-1_all.deb
 9f325fb30f9e9d176c37b8d89fa017c6 4483688 libs standard locales_2.7-1_all.deb
 86b9606c1de00db22982de06d90c2bbd 4983920 libs required libc6_2.7-1_amd64.deb
 296c806e92fd258bed0b88ddcbde09e4 2528488 libdevel optional libc6-dev_2.7-1_amd64.deb
 7aeaf2f2efb9677b4bbd452c49280f14 1960276 libdevel extra libc6-prof_2.7-1_amd64.deb
 078ce49695f08cce1d7b8e027bb332e3 1480310 libdevel optional libc6-pic_2.7-1_amd64.deb
 70cb9b1506e1e894d41e9e1b125a1acc 2749352 libs extra locales-all_2.7-1_amd64.deb
 5a5d4b0160735376014cf810931afd2c 3725380 libs optional libc6-i386_2.7-1_amd64.deb
 8607fd5a60d84e71779f9cd8aa284820 1429206 libdevel optional libc6-dev-i386_2.7-1_amd64.deb
 2b7847be9f0725ac7834ff06db5aeeee 169338 admin optional nscd_2.7-1_amd64.deb
 eb6a157d58bf4bf0155b5cdbe5070574 5315918 libdevel extra libc6-dbg_2.7-1_amd64.deb
 0d366bd2fd7922d9075f3d37d1923453 1129122 debian-installer extra libc6-udeb_2.7-1_amd64.udeb
 cf81903a9090e7ec4a6b3f561ae30fa1 9742 debian-installer extra libnss-dns-udeb_2.7-1_amd64.udeb
 d2a243f08779bd2a42c49aea46f99fc5 18018 debian-installer extra libnss-files-udeb_2.7-1_amd64.udeb
Package-Type: udeb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHRtadw3ao2vG823MRAjaNAJ0cPB0tgraAXi50Qqj3gHD7uJ8azwCfcywY
l48xWDP5yOEk+CC2r3c8+Wc=
=hVjC
-----END PGP SIGNATURE-----



--- End Message ---

Reply to: