Bug 217071 - math/gmp: upgrade to 6.1.2
Summary: math/gmp: upgrade to 6.1.2
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Alex Dupre
Depends on:
Reported: 2017-02-13 14:52 UTC by Iblis Lin
Modified: 2018-02-15 22:11 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (ale)

gmp.patch (1.20 KB, patch)
2017-02-13 14:52 UTC, Iblis Lin
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Iblis Lin 2017-02-13 14:52:42 UTC
Created attachment 179950 [details]

changelog: https://gmplib.org/gmp6.1.html

WARN: Makefile: --build, --mandir, and --infodir are not needed in CONFIGURE_ARGS as they are already set in bsd.port.mk.
0 fatal errors and 1 warning found.

poudriere testport: (I also ran the `make test` under poudriere interative mode)
  * pass on amd64, 11.0-RELEASE (with DEFAULT OPTIONS); make test pass
  * pass on i386 , 11.0-RELEASE (with DEFAULT OPTIONS); make test pass
  * pass on amd64, 10.3-RELEASE (with DEFAULT OPTIONS); make test pass
  * pass on i386,  10.3-RELEASE (with DEFAULT OPTIONS); make test pass
Comment 1 commit-hook freebsd_committer 2017-02-13 17:39:55 UTC
A commit references this bug:

Author: ale
Date: Mon Feb 13 17:39:41 UTC 2017
New revision: 434009
URL: https://svnweb.freebsd.org/changeset/ports/434009

  Finally update to 6.1.2 release, it should work fine with currently supported FreeBSD releases.

  PR:		217071
  Submitted by:	Iblis Lin <iblis@hs.ntnu.edu.tw>

Comment 2 Antoine Brodin freebsd_committer 2017-02-14 06:44:17 UTC
This breaks the build on head.
Comment 3 Alex Dupre freebsd_committer 2017-02-14 07:08:25 UTC
I'm investigating.

The error seems caused by a compiler bug:

Test compile: mpn_lshift_com optimization 2
configure:6805: cc -O2 -pedantic -fomit-frame-pointer -m64  conftest.c >&5
configure:6808: $? = 0
configure:6813: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
Abort trap (core dumped)
eval: ./b.out: not found
eval: ./a.exe: not found
eval: ./a_out.exe: not found
eval: ./conftest: not found
configure:6816: $? = 127
failed program was:
/* The following is mis-compiled by Intel ia-64 icc version 1.8 under
    "icc -O3",  After several calls, the function writes partial garbage to
    the result vector.  Perhaps relates to the chk.a.nc insn.  This code needs
    to be run to show the problem, but that's fine, the offending cc is a
    native-only compiler so we don't have to worry about cross compiling.  */
Comment 4 Iblis Lin 2017-02-14 08:34:49 UTC
6.1.2 can build on my 12.0-CURRENT #0 r313193...
Comment 5 Antoine Brodin freebsd_committer 2017-02-14 10:33:43 UTC
This should be fixed by ports r434069
Comment 6 Alex Dupre freebsd_committer 2017-02-14 10:56:18 UTC
What was exactly the issue?
Comment 7 Antoine Brodin freebsd_committer 2017-02-14 14:32:45 UTC
(In reply to Alex Dupre from comment #6)
When using malloc,  there is no guarantee that uninitialized memory will be filled with zero.

With malloc debugging turned on (opt.junk),  unitialized allocated is filled with 0xa5 and it breaks the mpn_lshift_com test  (it checks if some longs are still 0).

You can reproduce the problem on 10.3 or 11.0 with either clang or gcc by setting environement MALLOC_CONF to junk:true
Comment 8 Alex Dupre freebsd_committer 2017-02-14 15:59:25 UTC
I see. The test case wasn't very well documented, but it seems to verify that untouched allocated bytes are still zero, so it's clearly a bug to use malloc in that case. Thanks for fixing it.
Comment 9 Dennis Schridde 2018-02-15 22:11:38 UTC
(In reply to Alex Dupre from comment #3)

This was fixed upstream in "Recognise AMD zen." by Torbjorn Granlund <tg@gmplib.org>: https://gmplib.org/repo/gmp/rev/2ce5c60f5372

The same file (acinclude.m4) also received several other fixes recently: https://gmplib.org/repo/gmp/log/tip/acinclude.m4

I reported the issue and a request for backporting upstream: https://gmplib.org/list-archives/gmp-bugs/2018-February/004331.html