GNOME Bugzilla – Bug 748504
0.10.22: test-math fails on "powerpc" and "ppc64el"
Last modified: 2015-07-14 16:48:27 UTC
0.10.22 introduced regression which is causing test-math failure on "powerpc" and "ppc64el" architectures: https://buildd.debian.org/status/package.php?p=goffice&suite=sid 0.10.21: was building just fine: https://buildd.debian.org/status/package.php?p=goffice&suite=experimental See details in the following build logs: https://buildd.debian.org/status/fetch.php?pkg=goffice&arch=powerpc&ver=0.10.22-1&stamp=1430047320 https://buildd.debian.org/status/fetch.php?pkg=goffice&arch=ppc64el&ver=0.10.22-1&stamp=1430047182
I can see test-math failing, but I cannot see its output. Can you get the information in the relevant log file? Alternative, run it by hand and see what it says.
Here it is: ~~~~ ** ERROR:test-math.c:107:trig_tests: assertion failed: (copysign (1,r) == copysign (1,fa)) ~~~~
Created attachment 303129 [details] Expected output This is what I see. Immediately before your failure there should be the test it was performing. What is that? Also, this test uses copysign, a C99 feature. Any compilation warnings for the test?
You have access to build log -- why don't you check for warnings there? I'm not sure what check it was performing -- too bad I did not take a note when I had access to powerpc VM... Will try again...
Here is tail of `test-math.log`: ~~~~ sinpi(-1) = -0 [-0] cospi(-1) = -1 [-1] tanpi(-1) = -0 [-0] cotpi(-1) = -nan [-nan] atanpi(-1) = -0.25 [-0.25] sinpil(-1) = -0 [-0] cospil(-1) = -1 [-1] tanpil(-1) = 0 [-0] ** ERROR:test-math.c:107:trig_tests: assertion failed: (copysign (1,r) == copysign (1,fa)) ~~~~
Looks like a C library/compiler bug, :-/ #include <stdio.h> #include <assert.h> #include <math.h> int main (int argc, char **argv) { long double l = -1.0l; printf ("A: %Lg\n", l); l = fmodl (l, 1.0l); printf ("B: %Lg\n", l); assert (l == 0.0l); l = copysignl (0.0l, l); printf ("C: %Lg\n", l); return 0; } This should print A: -1 B: -0 C: -0
And for the record, I see no relevant warnings.
I've checked for warnings too but did not notice anything relevant...
Updated test program. This version ensures that things happen at run-time, not compile time. Just in case. Note, that the copysignl call here is utterly pointless, at least if copysignl works according to C99. It looks like a left-over from some editing. #include <stdio.h> #include <assert.h> #include <math.h> int main (int argc, char **argv) { long double l = (argc == 42 ? 1.0l : -1.0l); printf ("A: %Lg\n", l); l = fmodl (l, 1.0l); printf ("B: %Lg\n", l); assert (l == 0.0l); l = copysignl (0.0l, l); printf ("C: %Lg\n", l); return 0; }
http://en.wikipedia.org/wiki/Long_double suggests that powerpc may not conform to ieee for long double. If that is indeed the case, we have trouble. You can try configuring --without-long-double. That will eliminate the public APIs that take long double, but internally long double is still used in critical places such as go_dtoa. Or you can ignore the test and hope for the best.
--> NOTABUG. The test seems to correctly detect a system that isn't fulfilling the resuirements. See comment 10 for advice on moving forward.
How can I ignore a particular test on powerpc only? I'm not happy with just disabling all tests (or ignoring all test results). It appears to me that in order to build successfully on Debian/powerpc one needs to patch goffice in order to disable this particular test (or make it non-fatal) and the best place to do it is upstream i.e. here. Any chance for such patch to be introduced to goffice? Please?
I tried building Goffice with "--without-long-double" on amd64 and got FTBFS: ~~~~ test-math.c: In function ‘trig_tests’: test-math.c:106:3: error: implicit declaration of function ‘go_sinpil’ [-Werror=implicit-function-declaration] TEST1(d); ^ ~~~~ I did not try that on powerpc but it seems it might fail just as on amd64 so disabling test(s) appears to be the only option...
The compilation failure of comment 13 has been fixed. > Any chance for such patch to be introduced to goffice? No, really. The problem is not "The test fails because there is something wrong with the test." The problem is "The test fails because there is something wrong with either the hardware or the platform's ABI." The important difference here is that while I could tell the test to shut up, the problem it reports is real and goffice would not work right. Goffice depends on properly working floating-point. There is no easy workaround.
Morten, I think you misunderstood what am I saying... I understand that the test is correct. However we know it fails on powerpc hence my suggestion is to either make this test non-fatal on powerpc or disable this particular test on powerpc only. This is because I still want to run other tests and avoid ignoring all test results. At the moment the only way I can build goffice on powerpc is to run no tests or ignore their failure. I want to isolate this particular test only on powerpc.
*** Bug 751872 has been marked as a duplicate of this bug. ***