Bug 2038848 - python3.7 fails to build on s390x: test_pair and test_speech128 (test.test_zlib.CompressTestCase) fail
Summary: python3.7 fails to build on s390x: test_pair and test_speech128 (test.test_zl...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python3.7
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Karolina Surma
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: ZedoraTracker F36FTBFS 2044291
TreeView+ depends on / blocked
 
Reported: 2022-01-10 10:07 UTC by Miro Hrončok
Modified: 2022-02-24 23:35 UTC (History)
7 users (show)

Fixed In Version: python3.7-3.7.12-7.fc36
Clone Of:
Environment:
Last Closed: 2022-02-03 12:13:08 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Python 46623 0 None None None 2022-02-03 08:49:20 UTC

Description Miro Hrončok 2022-01-10 10:07:31 UTC
During the coordinated Rawhide libffi rebuild, I've noticed python3.7 fails to build on s390x:

======================================================================
FAIL: test_pair (test.test_zlib.CompressObjectTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/Python-3.7.12/Lib/test/test_zlib.py", line 238, in test_pair
    self.assertEqual(x1 + x2, datazip)
AssertionError: b'x\x9c\xe2\xf2qt\r\nq\r\xe6\xe2R\x80\x00\x7f\x1d\x[98329 chars]\x95' != b'x\x9c\xe3\xf2qt\r\nq\r\xe6\xe2R\x80\x00\x7f\x1d\x[115073 chars]\x95'
======================================================================
FAIL: test_speech128 (test.test_zlib.CompressTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/Python-3.7.12/Lib/test/test_zlib.py", line 181, in test_speech128
    self.assertEqual(zlib.compress(bytearray(data)), x)
AssertionError: b'x\x[4440 chars]c\x02\xa6\xb4\x02.\xc6Q\x01\xa3V\'\xbe\xf9\xb8[109483 chars]\x95' != b'x\x[4440 chars]c\x02&\xb7\x02\xce!P\x01\xa3V\'\xbe\xf9\xb8*\x[110633 chars]\x95'
----------------------------------------------------------------------


s390x is likely the only affected architecture.


Original Koji builds: https://koji.fedoraproject.org/koji/taskinfo?taskID=80984971 and https://koji.fedoraproject.org/koji/taskinfo?taskID=80997410



Full arch scratch build with libffi 3.4: https://koji.fedoraproject.org/koji/taskinfo?taskID=81054710

Comment 1 Victor Stinner 2022-01-10 11:59:34 UTC
The same test failures have been reported on RHEL8 and the issue was closed as "NOT A BUG". See the issues for details: https://bugzilla.redhat.com/show_bug.cgi?id=1974658

Comment 2 Victor Stinner 2022-01-10 12:02:16 UTC
> python3.7 fails to build on s390x: test_pair and test_speech128 (test.test_zlib.CompressTestCase) fail

The s390x has a hardware accelerator for gzip. Depending if the hardware accelerator is used or not, the output is different.

Also, test_zlib compress data in two different ways and then expect the same output. It works with the sofware implementation which creates a single block. It doesn't work with the hardware implementation which creates multiple blocks. Maybe the hardware implementation has a shorter buffer or doesn't implement the optimization avoiding the creation of multiple blocks.

Comment 3 Miro Hrončok 2022-01-10 12:26:58 UTC
Full arch scratch build with libffi 3.1: https://koji.fedoraproject.org/koji/taskinfo?taskID=81058354

It shows the same error, so this is not libffi related.

The previous scratch build with libffi 3.4 has finished, it shows that this is s390x specific.

Comment 4 Miro Hrončok 2022-01-10 13:53:10 UTC
The related RHEL 8 bugzilla bz1974658 is now public.

Comment 5 Tomas Orsava 2022-02-01 10:46:14 UTC
Let's solve this by skipping these two tests on s390x.

Comment 7 Victor Stinner 2022-02-03 08:49:21 UTC
I proposed a PR upstream to skip test_pair() and test_speech128() on s390x:

* https://bugs.python.org/issue46623
* https://github.com/python/cpython/pull/31096

Comment 8 Fedora Update System 2022-02-03 12:10:08 UTC
FEDORA-2022-f550633b7d has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-f550633b7d

Comment 9 Fedora Update System 2022-02-03 12:13:08 UTC
FEDORA-2022-f550633b7d has been pushed to the Fedora 36 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 10 Victor Stinner 2022-02-24 23:35:39 UTC
FYI I made a similar change in Python 3.11 upstream:

* https://github.com/python/cpython/commit/9475dc0b8d2a0db40278bbcb88a89b1265a77ec9
* https://bugs.python.org/issue46623#msg413939


Note You need to log in before you can comment on or make changes to this bug.