macOS Catalina: FAIL: t-powm

Torbjörn Granlund tg at
Sat Nov 16 09:14:10 UTC 2019

Jack Howarth <howarth.mailing.lists at> writes:

       The failure in the t-powm test case isn't fixed by Xcode 11.2 and
  still exists in Xcode 11.3 beta. Note that Apple's clang diverges enough
  from LLVM clang that there will be Apple specific regressions not present
  in the LLVM clang compiler. However I have found the triggering compiler
  flag. Using Xcode 11.3 beta and the building with...

Thanks for checking!

  However, if I execute at that point...

  cd tests/mpz
  gcc -DHAVE_CONFIG_H -I. -I../..  -I../.. -I../../tests   -O2 -pedantic -m64
  -mtune=core2 -march=core2 -c -o t-powm.o t-powm.c

  with the -fomit-frame-pointer removed and then execute...

  cd ../..
  make check

  I get the desired...

  PASS: t-powm


I tried to read the documentation for -fomit-frame-pointer in cc's man
page.  It is not mentioned.  But then many other options which clearly
work are also not mentioned.

  Is the problematic test case being compiled with....

  gcc -DHAVE_CONFIG_H -I. -I../..  -I../.. -I../../tests   -O2 -pedantic
  -fomit-frame-pointer -m64 -mtune=core2 -march=core2 -c -o t-powm.o t-powm.c

  on your Mac?

Same same but different:

  -O2 -pedantic -fomit-frame-pointer -m64 -mtune=broadwell -march=broadwell

Is tests/mpz/t-powm the only failure you see?  That fails for me too,
but I get segfault also for tests/mpn/t-fib2m.

It might be tempting to simply suppress -fomit-frame-pointer on Macos
and hope we trigger no more bugs.  But I don't do that sort of
workarounds for GMP, as they do not tend to be effective, and as it
would gradually make GMP harder to maintain.

I don't have any good contacts at Apple, but if somebody here does,
please try to make them take this bug seriously.

(There is a non-zero probability that these GMP test suite failures are
caused by bugs in GMP.  We cannot tell for sure, as we have not isolated
the failures.  I don't have any desire to isolate another GMP test suite
failure which resulted from a compile with clang.  And as gdb no longer
works on Macos, I would feel like a beginner programmer again.

The number of bugs of this sort in released GMP has been very close to
zero in the 28 years GMP has been around.  That's because the GMP
developers insist on using long outdated engineering: careful
coding and testing.)

Please encrypt, key id 0xC8601622

More information about the gmp-bugs mailing list