Possible issue on windows build (mingw)

Vlad Gabriel clampi at yahoo.com
Tue Apr 3 02:28:03 CEST 2012


Hello Torbjörn,

0) Grabbed gmp-5.0.90-20120402.tar.xz.
1) It didn't. Had one test failed still.
2) Have 2 names:
"mpn/x86_64/coreisbr/aorrlsh_n.asm" causes the following assert in many tests:
toom_eval_pm2exp.c:112: GNU MP assertion failed: (k+1)*shift >= 64 || xp2[n] < ((((mp_limb_t) 1LL)<<((k+1)*shift))-1)/((((mp_limb_t) 1LL)<<shift)-1)


"mpn/x86_64/core2/gcd_1.asm" causes the following test failure:
ERROR in test 38
mpz_gcd returned incorrect result
op1=18F61
op2=7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
expected result:
1
mpz_gcd returns:
E00000000
FAIL: t-gcd.exe

I also seen a strange behavior regarding "x86_64/coreisbr/gmp-mparam.h":

-    Not having any asm or gmp-mparam file in "x86_64/coreisbr" (configure picked up mpn/x86_64/coreinhm/gmp-mparam.h) caused just the following error.
ERROR (test 0/4): bad mpq_get_d results
last: 2.831170559451512e+042
 new: 3.777921564596099e+023
36489283802728456212808968192497028767963742267744519202282283035699668481726902297046707635167271637316068170768985699126422206261277521661446482291800801597549527636500294216045011769371840538522284526833040176934499498846977051498446327100813844317517022067245992692782131478953358177666681136778862956078702957225453402316143817090931402573833213357529137090316460617139627364828843593061290105155663089228551105870795363341870880469604882250963499563649410083211/96585604488666928433401134762084891101785983567628623339968405650951595366577934477621634908525711203953506019895220649709536318296189492875797337317806299863791508466456467249150206639814242905329528625648052839802841449643341723751787364562835843642712250958707322035089635882839943654473752832945591316732350395144834030871094645808259009760252032805921902410523858134721041448026139438793004870433895622485118790360722867310133851996553216
FAIL: t-get_d.exe


-    Having just gmp-mparam file in "x86_64/coreisbr" caused just the following errors:
ERROR in test 38
mpz_gcd returned incorrect result
op1=18F61
op2=7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
expected result:
1
mpz_gcd returns:
E00000000
FAIL: t-gcd.exe


ERROR (test 0/6): bad mpq_get_d results
last: 9.812762848509795e+055
 new: 1.977541358830227e+048
1836271237341295859612898827076534101128907148541526348485562245876958304759219721269767425728676382937455401999767574284401997674306336874703759271976542771636393707130456758076162310043257458673547956492326871907229280035156650172987953389843577824495835653543183448490834064125919766846006633844362221724150772955677596467869045155756125232309954176052095888664529937906616139772001432572550085221821277350150591207364582851160959389372421780101760557192433829555143849879024884210092675890225797997320610782770304211565150023567714714424272329226110006673104984413756995350308797109509651909603362743467621999199/92856274744488974759256854913044264188778140879261886568031390253856895073438403365285464835469195303328427607734724015166019459987691867528205062944635996249580977032960568774808293864481729137607152625909510661947371257705487097773846697002488527114787103481621788401813638983122630838048005039406591222203177076134078907497951955513243818617754382
5149534555984741631154253376452933500406069451804592836816158898355970937021755301022986670236951505605022548173483834231464935072132989143885004748169043588667107512105640309715047743018741798159064368578541192740864
FAIL: t-get_d.exe


I thought gmp-mparam.h was just a "tuner" for performance, but it seems that it also affects bad behavior in other routines.


Hope it helps.

Best Regards,
Gabriel


________________________________
 From: Torbjorn Granlund <tg at gmplib.org>
To: Vlad Gabriel <clampi at yahoo.com> 
Cc: "gmp-bugs at gmplib.org" <gmp-bugs at gmplib.org> 
Sent: Monday, April 2, 2012 4:04 PM
Subject: Re: Possible issue on windows build (mingw)
 
Vlad Gabriel <clampi at yahoo.com> writes:

  While building the latest gmp (from Mercurial repository) I ran the following commands:
  
Unfortunately, "the latest" gmp is not a unique description of the
source tree.

It is probably a better strategy to take one of the daily snapshots,
since then we can work with the exact same sources when trying to
reproduce problems.

  ../gmp-hg/configure --enable-maintainer-mode --enable-cxx --enable-shared --disable-static --enable-assert
  [...configure runs, correctly detects my processor as I7 Sandy Bridge, which is correct ...]

Unfortunately, I have no windos system using that processor.  I have a
i7 nehalem (virtualised) system where I seem to fail with reproducing
this massive problem.
  
(We have reproduced the 2nd problem, and a fix is about to be checked
in.)
  
  Either configure picks up the wrong assembler routines, or the
  routines are not designed to work with windows calling convention.

I agree with this analysis.  Probably one the the files in
mpn/x86_64/coreisbr claims to work for "DOS64" but actually doesn't.

Could you please try the following for us:

0. Grab a snapshot, to put us on the same source code.

1. Hide all ".asm" files from mpn/x86_64/coreisbr in, say,
   mpn/x86_64/hidden.

2. Repeat your configure+build procedure.  I assume things will now work.

3. Replace file after file from mpn/x86_64/hidden to mpn/x86_64/coreisbr,
   then rebuild from scratch.  When you see the massive failures again,
   you've found the culprit.  Please give us the name...

-- 
Torbjörn


More information about the gmp-bugs mailing list