Re: register corruption under MS Windows / x86-64

2017-12-15 Thread Torbjörn Granlund
Vincent Lefevre  writes:

  One of those who saw the bug with MPFR 4 RC1 + GMP dev said that
  everything seems fine with the latest GMP dev:
  
https://sympa.inria.fr/sympa/arc/mpfr/2017-12/msg00067.html

Thanks.

-- 
Torbjörn
Please encrypt, key id 0xC8601622
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs


Re[2]: register corruption under MS Windows / x86-64

2017-12-15 Thread sav_ix

Updated GMP sources to r17506.
MPFR (r11929) builds with GMP using  with 
  configurations finished successfully and all 
tests, including previously failed, passed for both libraries. Thank you for 
fix!



--- Оригінальне повідомлення ---
Від кого: "Torbjörn Granlund" 
Дата: 15 грудня 2017, 01:00:42


 
  It is a flaw in our testing setup that this calling convention breach is
  not caught by the automated testing.  I will fix both bugs.  :-)
  
I have now pushed a fix for the mainline repo.  Testing would be
appreciated!

Improving test suite calling conventions checks (through
tests/x86call.asm) still needs to be done.

  Unfortunately the same issue might affect released versions of GMP.  It
  is not immediately clear, as all problem code lives in x86_64/fastsse,
  code which is then explicitly included from CPU specific subdirs.

This is still pending.

-- 
Torbjörn
Please encrypt, key id 0xC8601622
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs


Re: register corruption under MS Windows / x86-64

2017-12-15 Thread Vincent Lefevre
On 2017-12-15 00:00:40 +0100, Torbjorn Granlund wrote:
>   It is a flaw in our testing setup that this calling convention breach is
>   not caught by the automated testing.  I will fix both bugs.  :-)
>   
> I have now pushed a fix for the mainline repo.  Testing would be
> appreciated!

One of those who saw the bug with MPFR 4 RC1 + GMP dev said that
everything seems fine with the latest GMP dev:

  https://sympa.inria.fr/sympa/arc/mpfr/2017-12/msg00067.html

-- 
Vincent Lefèvre  - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs


Re: register corruption under MS Windows / x86-64

2017-12-14 Thread Torbjörn Granlund
  
  It is a flaw in our testing setup that this calling convention breach is
  not caught by the automated testing.  I will fix both bugs.  :-)
  
I have now pushed a fix for the mainline repo.  Testing would be
appreciated!

Improving test suite calling conventions checks (through
tests/x86call.asm) still needs to be done.

  Unfortunately the same issue might affect released versions of GMP.  It
  is not immediately clear, as all problem code lives in x86_64/fastsse,
  code which is then explicitly included from CPU specific subdirs.

This is still pending.

-- 
Torbjörn
Please encrypt, key id 0xC8601622
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs


Re: register corruption under MS Windows / x86-64

2017-12-11 Thread Torbjörn Granlund
Vincent Lefevre  writes:

  There appears to be a bug in mpn/x86_64/fastsse/com-palignr.asm,
  which is now used by the GMP trunk. If I understand correctly,
  the optimized loop uses xmm6 and xmm7 without restoring their
  values. This is correct under Linux, but not under MS Windows,

You are right, and we seem to have been aware of this at some point:

  2013-09-16  Torbjorn Granlund  
* mpn/x86_64/fastsse/copyi-palignr.asm: Preserve xmm6-xmm8 under DOS.

It is a flaw in our testing setup that this calling convention breach is
not caught by the automated testing.  I will fix both bugs.  :-)

Unfortunately the same issue might affect released versions of GMP.  It
is not immediately clear, as all problem code lives in x86_64/fastsse,
code which is then explicitly included from CPU specific subdirs.

-- 
Torbjörn
Please encrypt, key id 0xC8601622
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs


register corruption under MS Windows / x86-64

2017-12-10 Thread Vincent Lefevre
There appears to be a bug in mpn/x86_64/fastsse/com-palignr.asm,
which is now used by the GMP trunk. If I understand correctly,
the optimized loop uses xmm6 and xmm7 without restoring their
values. This is correct under Linux, but not under MS Windows,
according to:

  
https://en.wikipedia.org/wiki/X86_calling_conventions#x86-64_calling_conventions

which says:

  In x86-64, Visual Studio 2008 stores floating point numbers in XMM6
  and XMM7 (as well as XMM8 through XMM15); consequently, for x86-64,
  user-written assembly language routines must preserve XMM6 and XMM7
  (as compared to x86 wherein user-written assembly language routines
  did not need to preserve XMM6 and XMM7). In other words,
  user-written assembly language routines must be updated to
  save/restore XMM6 and XMM7 before/after the function when being
  ported from x86 to x86-64.

Since the commit https://gmplib.org/repo/gmp/rev/069ff6facc35 [*]
(which enables this asm file), MS Windows users get obscure failures
in MPFR 4.0.0-rc1 (debugging shows a floating-point value becoming
NaN) under some conditions (depending on whether optimizations are
used, on output of debug information, and on whether the library is
shared or static...).

[*] https://sympa.inria.fr/sympa/arc/mpfr/2017-12/msg00045.html

More information here:

  https://sympa.inria.fr/sympa/arc/mpfr/2017-12/msg00051.html

and in earlier messages of the thread.

-- 
Vincent Lefèvre  - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs