Skip to content

test_free_threading.test_zlib fails on s390x with hardware zlib accelerator #159425

Description

@vstinner

On s390x, zlib can use s390x hardware accelerator. Problem: test_free_threading.test_zlib makes an assumption on how zlib buffer works, which is wrong when the accelerator is used.

Example on s390x RHEL9:

$ ./python -m test test_free_threading.test_zlib -v
== CPython 3.15.0 free-threading build (main, Oct 14 2026, 11:50:28) [GCC 11.5.0 20240719 (Red Hat 11.5.0-14)]
== Linux-5.14.0-687.49.1.el9_8.s390x-s390x-with-glibc2.34 big-endian
== Python build: free_threading debug
...
======================================================================
FAIL: test_compressor (test.test_free_threading.test_zlib.TestZlib.test_compressor)
----------------------------------------------------------------------
Traceback (most recent call last):
  ...
  File "/home/vstinner/Python-3.15.0/Lib/test/test_free_threading/test_zlib.py", line 27, in worker
    self.assertEqual(data, b"")
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^
AssertionError: b'\xd7\x08\xaf\x80Gz\x05<\xd2+\xe0\x91^\x01[40 chars]\x8f' != b''
...

The test pass if I disable the accelerator:

$ DFLTCC_LEVEL_MASK=0 ./python -m test test_free_threading.test_zlib -v
...
Result: SUCCESS

Python built with ./configure --with-pydebug --disable-gil.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytestsTests in the Lib/test dirtopic-free-threading

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions