diff mbox series

[meta-python,1/2] python3-pyzmq: skip test_close_all_fds ptest on musl

Message ID 20260927195531.101194-1-khem.raj@oss.qualcomm.com
State New
Headers show
Series [meta-python,1/2] python3-pyzmq: skip test_close_all_fds ptest on musl | expand

Commit Message

Khem Raj Sept. 27, 2026, 7:55 p.m. UTC
test_close_all_fds closes the socket through the IOLoop's shadow socket
and then reads s.closed. pyzmq implements that by calling
zmq_getsockopt() on the handle, which libzmq's reaper thread may already
have freed. With glibc the memory stays mapped, libzmq's tag check fails
and ENOTSOCK comes back; musl's allocator can unmap it, so the ptest run
segfaults intermittently and loses every result after it:

  File ".../tests/test_future.py", line 319 in test_close_all_fds
  Segmentation fault (core dumped)

Closing a socket via a shadow and then querying .closed on the original
segfaults on musl every time in a standalone reproducer and survives on
glibc. Skip the test for musl.

Tested with meta-python-image-ptest-python3-pyzmq on qemux86-64 with
yoe-musl-systemd-wayland.

AI-Generated: Uses Claude Code
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
---
 meta-python/recipes-devtools/python/python3-pyzmq_27.2.0.bb | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/meta-python/recipes-devtools/python/python3-pyzmq_27.2.0.bb b/meta-python/recipes-devtools/python/python3-pyzmq_27.2.0.bb
index 606e34e69f..bbce601f3f 100644
--- a/meta-python/recipes-devtools/python/python3-pyzmq_27.2.0.bb
+++ b/meta-python/recipes-devtools/python/python3-pyzmq_27.2.0.bb
@@ -61,3 +61,9 @@  do_install_ptest() {
         cp -rf ${S}/tests/* ${D}${PTEST_PATH}/tests/
         install -m 0644 ${S}/pytest.ini ${D}${PTEST_PATH}/pytest.ini
 }
+
+do_install_ptest:append:libc-musl() {
+        sed -i -e "s/ and not test_process_teardown'/ and not test_process_teardown and not test_close_all_fds'/" \
+            ${D}${PTEST_PATH}/run-ptest
+        grep -q "not test_close_all_fds'" ${D}${PTEST_PATH}/run-ptest || bbfatal "failed to skip test_close_all_fds in run-ptest"
+}