The canard à l'orange release, patch level 2.
MPFR 3.1.2 requires GMP 4.1.0 or higher (GMP 4.2.3 or higher is recommended).
Note: the bug-fix release MPFR 3.1.3 is available. Please upgrade!
Warning! Due to the fact that Thread-Local Storage
(TLS) support is now detected
automatically, the MPFR build can be incorrect on some
platforms (compiler or system bug). Indeed,
the
TLS implementation of some compilers/platforms is buggy,
and MPFR cannot detect every problem at configure time.
Please run make check
to see if your build is affected.
If you get failures, you should try the --disable-thread-safe
configure option to disable TLS and see if this solves
these failures. But you should not use an MPFR library
with TLS disabled in a multithreaded program (unless
you know what you are doing).
The MPFR 3.1.2 source can be downloaded in the following archive formats:
Each tarball is signed by Vincent Lefèvre. This can be verified using the DSA key ID 98C3739D; this key can be retrieved with:
gpg --recv-keys 98C3739D
or by downloading it from https://www.vinc17.net/pgp.html. The key fingerprint is:
07F3 DBBE CC1A 3960 5078 094D 980C 1976 98C3 739D
The signatures can be verified with:
gpg --verify file.asc
You should check that the key fingerprint matches.
MPFR is also available via third-party packages and ports.
The bugs listed below have been fixed (latest update: 2014-12-04). The patches are distributed under the same license as this version of MPFR, that is, the GNU Lesser General Public License (GNU Lesser GPL), version 3 or later.
The following instructions are for Linux and may be similar for other operating systems. You can apply the patches in several ways:
patch -N -Z -p1 < path_to_patches_filefrom the source directory. The -N option allows the patch command to ignore patches already applied. The -Z option sets the modification time of the patched files from time stamps given in the patch file, thus avoiding the need of some development utilities (such as autoconf); this may generate a
Not setting timewarning for the PATCHES file, but you can safely ignore it. Under Microsoft Windows, in addition to the above options, you may need the --binary option (this depends whether the end-of-lines have been converted when you downloaded the patch file). Also note that the --dry-run option does not work if the cumulative patch has some file listed several times.
svn co svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1 mpfr-3.1In this case, as said on the Gforge page, you should read the README.dev file for details on how to build MPFR. Also note that the branch may contain additional minor fixes.
With the first two ways, the PATCHES file is modified,
so that one can know what patches have been applied, using the
mpfr_get_patches
function. Moreover a suffix is added to
the version string, but note that for practical reasons, not all the
files where the version appears are patched; thus one can also track
applied patches with the MPFR_VERSION_STRING
macro (header)
and the mpfr_get_version
function (library). However, if
some patches are not applied or if patches are applied in a different
order, then the patch command will fail to update some chunks, so that
the suffix is not always reliable for patches.
Note: These patches are in unified diff format and some vendors' patch commands cannot deal with them; in this case, please use GNU patch (it may already be installed on your system, e.g. as /usr/local/bin/patch or gpatch).
Fixed bugs, with patches:
mpfr_exp
implementations uses a left
shift on an integer that can be negative: exps <<= 1;
and this has an undefined behavior according to the ISO
C standard. In most cases, this will correspond to a multiplication by 2,
and the code will behave as expected (this is why the bug hadn't been
detected until now). But problems may occur if a sanitizer is used (this is
how this bug was detected) or possibly in case of advanced optimizations,
such as LTO.
This is fixed by the exp_2 patch.mpfr_fits_u*_p
functions return 0
(doesn't fit) instead of non-zero (
fits) on negative arguments for which the rounding to an integer in the given rounding mode is 0. This bug is fixed by the fits-smallneg patch, which also updates the testcases.
double
. These problems
are fixed by the clang-divby0 patch,
which also disables constant division by zero on the native C type
double
with Clang in order to avoid
incorrect code.mpfr_exp
can be incorrect for
output precisions larger than or equal to MPFR_EXP_THRESHOLD
(several thousands of bits; its value depends on the architecture). This
bug is fixed by the exp3 patch, which
also provides a testcase.mpfr_strtofr
.
This is due to incorrect GMP documentation for
mpn_set_str
about the size of a buffer
(discussion;
first fix in the GMP documentation). This bug is present in the
MPFR versions from 2.1.0 (adding mpfr_strtofr
)
to this one, and can be detected by running make checkin a 32-bit ABI under GNU/Linux with
alloca
disabled (this is currently possible by using the
--with-gmp-build configure option where alloca
has been disabled in the GMP build). It is fixed by
the strtofr patch.Other bugs are fixed in the 3.1 branch (for the future MPFR 3.1.3 release). The main ones are:
mpfr_mul_ui
, affecting mpfr_mul_si
too (fix in changeset cc362a9b (r9516)).mpfr_sin
function can modify the exponent range, extending it to the maximum (fix in changeset 83d68d35 (r9548)). Note: this is a potential vulnerability if the application relies on small exponent range to avoid denial of service due to trigonometric functions taking much memory on inputs with a very large positive exponent.mpfr_fma
function does always round correctly in case of underflow (fix in changeset f916dd04 (r9570)). The mpfr_fms
function is affected too as a consequence.The other fixed bugs are minor ones, such as support for very reduced exponent range in more functions.
See the tracker and the BUGS file.
Note: The official tarballs for MPFR up to 3.1.1 were affected by a vulnerability for make distcheck due to a bug in old GNU Automake versions. One of the purposes of this release is to provide tarballs without this vulnerability.
MPFR 3.1.2 has been successfully compiled and checked on the following platforms: