Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

s390x: 3 test failures on Fedora Rawhide #160

Closed
tuliom opened this issue Feb 16, 2021 · 8 comments
Closed

s390x: 3 test failures on Fedora Rawhide #160

tuliom opened this issue Feb 16, 2021 · 8 comments

Comments

@tuliom
Copy link
Member

tuliom commented Feb 16, 2021

While updating libdfp on Fedora Rawhide, I noticed the following failures on s390x:

Details of failed tests:
cat ./test-bfp-conversions.out
cat ./test-cast-to-overflow.out
cat ./test-cast-to-underflow.out
FAIL: test-bfp-conversions
FAIL: test-cast-to-overflow
FAIL: test-cast-to-underflow
Summary of test results:
      3 FAIL
    165 PASS

Source: https://koji.fedoraproject.org/koji/taskinfo?taskID=62029024

I still don't have much information about them.
Notice that Rawhide is using GCC 11 now.

@tuliom
Copy link
Member Author

tuliom commented Feb 16, 2021

More details:

Details of failed tests:
cat ./test-bfp-conversions.out
12.345 = (double) 12.345DF
1   Success: Expected: "0x1.8b0a3d70a3d710p+3"
             Result:   "0x1.8b0a3d70a3d710p+3"
in: /builddir/build/BUILD/libdfp-1.0.15/tests/test-bfp-conversions.c:168
2.0 = (double) 2.0DF
2   Success: Expected: "0x1.00000000000000p+1"
             Result:   "0x1.00000000000000p+1"
in: /builddir/build/BUILD/libdfp-1.0.15/tests/test-bfp-conversions.c:169
3.402819e+38 = (double) 3.402819e+38DF
3   Success: Expected: "0x1.ffffd1f5422830p+127"
             Result:   "0x1.ffffd1f5422830p+127"
in: /builddir/build/BUILD/libdfp-1.0.15/tests/test-bfp-conversions.c:170
9.999998e96 = (double) 9.999998e96DF
4   Success: Expected: "0x1.2ba091ef1520b0p+322"
             Result:   "0x1.2ba091ef1520b0p+322"
in: /builddir/build/BUILD/libdfp-1.0.15/tests/test-bfp-conversions.c:171
100000 = (double) 100000.0DF
5   Success: Expected: "0x1.86a00000000000p+16"
             Result:   "0x1.86a00000000000p+16"
in: /builddir/build/BUILD/libdfp-1.0.15/tests/test-bfp-conversions.c:172
999999 = (double) 999999.0DF
6   Success: Expected: "0x1.e847e000000000p+19"
             Result:   "0x1.e847e000000000p+19"
in: /builddir/build/BUILD/libdfp-1.0.15/tests/test-bfp-conversions.c:173
1.e-39 = (double) 1.e-39DF
7   Success: Expected: "0x1.5c72fb1552d830p-130"
             Result:   "0x1.5c72fb1552d830p-130"
in: /builddir/build/BUILD/libdfp-1.0.15/tests/test-bfp-conversions.c:174
-1.e-39 = (double) -1.e-39DF
8   Success: Expected: "-0x1.5c72fb1552d830p-130"
             Result:   "-0x1.5c72fb1552d830p-130"
in: /builddir/build/BUILD/libdfp-1.0.15/tests/test-bfp-conversions.c:175
1.2e-38 = (double) 1.2e-38DF
9   Success: Expected: "0x1.05563c4ffe2230p-126"
             Result:   "0x1.05563c4ffe2230p-126"
in: /builddir/build/BUILD/libdfp-1.0.15/tests/test-bfp-conversions.c:176
1.e-40 = (double) 1.e-40DF
10  Success: Expected: "0x1.16c262777579c0p-133"
             Result:   "0x1.16c262777579c0p-133"
in: /builddir/build/BUILD/libdfp-1.0.15/tests/test-bfp-conversions.c:177
8.e-44 = (double) 8.e-44DF
11  Success: Expected: "0x1.c8b82188545670p-144"
             Result:   "0x1.c8b82188545670p-144"
in: /builddir/build/BUILD/libdfp-1.0.15/tests/test-bfp-conversions.c:178
9.e-44 = (double) 9.e-44DF
12  Success: Expected: "0x1.00e792dcaf70a0p-143"
             Result:   "0x1.00e792dcaf70a0p-143"
in: /builddir/build/BUILD/libdfp-1.0.15/tests/test-bfp-conversions.c:179
8.e-46 = (double) 8.e-46DF
13  Success: Expected: "0x1.244ce242c55610p-150"
             Result:   "0x1.244ce242c55610p-150"
in: /builddir/build/BUILD/libdfp-1.0.15/tests/test-bfp-conversions.c:180
-9.e-44 = (double) -9.e-44DF
14  Success: Expected: "-0x1.00e792dcaf70a0p-143"
             Result:   "-0x1.00e792dcaf70a0p-143"
in: /builddir/build/BUILD/libdfp-1.0.15/tests/test-bfp-conversions.c:181
-8.e-46 = (double) -8.e-46DF
15  Success: Expected: "-0x1.244ce242c55610p-150"
             Result:   "-0x1.244ce242c55610p-150"
in: /builddir/build/BUILD/libdfp-1.0.15/tests/test-bfp-conversions.c:182
-7.0 = (double) -7.0DD
16  Success: Expected: "-0x1.c0000000000000p+2"
             Result:   "-0x1.c0000000000000p+2"
in: /builddir/build/BUILD/libdfp-1.0.15/tests/test-bfp-conversions.c:186
3.402819e+38 = (double) 3.402819e+38DD
17  Success: Expected: "0x1.ffffd1f5422830p+127"
             Result:   "0x1.ffffd1f5422830p+127"
in: /builddir/build/BUILD/libdfp-1.0.15/tests/test-bfp-conversions.c:187
1.79768e+308 = (double) 1.79768e+308DD
18  Success: Expected: "0x1.ffff0ad58f4450p+1023"
             Result:   "0x1.ffff0ad58f4450p+1023"
in: /builddir/build/BUILD/libdfp-1.0.15/tests/test-bfp-conversions.c:188
100000000000000 = (double) 100000000000000.0DD
19  Success: Expected: "0x1.6bcc41e9000000p+46"
             Result:   "0x1.6bcc41e9000000p+46"
in: /builddir/build/BUILD/libdfp-1.0.15/tests/test-bfp-conversions.c:189
999999999999999 = (double) 999999999999999.0DD
20  Success: Expected: "0x1.c6bf52633fff80p+49"
             Result:   "0x1.c6bf52633fff80p+49"
in: /builddir/build/BUILD/libdfp-1.0.15/tests/test-bfp-conversions.c:190
1.e290 = (double) 1.e290DD
21  Successcat ./test-cast-to-overflow.out
cat ./test-cast-to-underflow.out
FAIL: test-bfp-conversions
FAIL: test-cast-to-overflow
FAIL: test-cast-to-underflow
Summary of test results:
      3 FAIL
    165 PASS

Source: https://koji.fedoraproject.org/koji/taskinfo?taskID=62087722

@pmur
Copy link
Contributor

pmur commented Feb 16, 2021

@stliibm FYI.

@tuliom
Copy link
Member Author

tuliom commented Feb 16, 2021

Notice the same SRPM pass all the tests on F33 (GCC 10): https://koji.fedoraproject.org/koji/taskinfo?taskID=62088777

@tuliom
Copy link
Member Author

tuliom commented Feb 16, 2021

I've recently backported 2 patches to Fedora. The code is available at: https://src.fedoraproject.org/fork/tuliom/rpms/libdfp/tree/bug/1923668

@stliibm
Copy link
Member

stliibm commented Feb 17, 2021

I was able to reproduce it on my system with a self build gcc (commit 78a6d0e30d7950216dc0c5be5d65d0cbed13924c).

All three testcases are segfaulting as they run out of stack due to recursive calls to itself in __dpd_extend/trunc functions while converting _Decimal128|64|32 to or from long double. This is a GCC 11 regression as the pfpo instruction should be used for all bpf <-> dfp conversions as done with previous GCC versions.

I've opened GCC Bugzilla:
"Bug 99134 - S390x: pfpo instructions are not used for dfp[128|64|32] to/from long double conversions"
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99134

  • tests/test-bfp-conversions.c:
404: DO_TEST(TF,TD,);
=> converting long double to _Decimal128
in sysdeps/s390/dfpu/extendtftd.c:
     0x3fffdb885b8 <__GI___dpd_extendtftd+40>        brasl       %r14,0x3fffdb86e80 <__dpd_extendtftd@plt>
     => recursive call (instead of pfpo instruction)!
  • tests/test_cast_to_overflow.c:
231:       ret = (long double) d128to128[i].set;
=> converting _Decimal128 to long double
in sysdeps/s390/dfpu/trunctdtf.c:
     0x3fffdb89788 <__GI___dpd_trunctdtf+40> brasl	%r14,0x3fffdb86d80 <__dpd_trunctdtf@plt>
     => recursive call (instead of pfpo instruction)!
  • tests/test-cast-to-underflow.c:
484:               ret = (long double) d128to128[i].set;
=> converting _Decimal128 to long double
(see tests/test_cast_to_overflow.c)

@stliibm
Copy link
Member

stliibm commented Feb 22, 2021

I've just restested libdfp with gcc-head:
$ git log --oneline
60b99ee3bc0 (HEAD -> master, origin/master, origin/HEAD) Daily bump.
...
b6e446cb581 IBM Z: Fix long double <-> DFP conversions
a974b8a592e IBM Z: Improve FPRX2 <-> TF conversions
=> See also GCC-Bugzilla:
"Bug 99134 - S390x: pfpo instructions are not used for dfp[128|64|32] to/from long double conversions"
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99134

Now all the long double <-> _Decimal data-type conversions are using the pfpo instruction and the libdfp testsuite passes.

@tuliom Is Fedora automatically syncing its pre "GCC11" to the latest gcc HEAD? Or do we have to enforce this somehow?

@tuliom
Copy link
Member Author

tuliom commented Feb 23, 2021

@stliibm No, I don't think it's automatic. But they've been updating it frequently.
The last update was 12 days ago, so I expect a new one soon.
I'll keep an eye on it in order to rebuild libdfp with my patches there.

Thank you!

@tuliom
Copy link
Member Author

tuliom commented Mar 23, 2021

gcc-11.0.0-0.20.fc34 has just landed on Fedora 34 and this issue has been fixed.
I created a PR to merge the latest updates: https://src.fedoraproject.org/rpms/libdfp/pull-request/6

@tuliom tuliom closed this as completed Mar 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants