Andreas Tille pushed to branch ariba at Debian Med / python-pysam
Commits: 710447f1 by Andreas Tille at 2026-11-04T09:10:03+01:00 Use Assisted-By: in patch - - - - - d9da4655 by Andreas Tille at 2026-11-04T09:13:29+01:00 Wait for further review and deactivate patch - - - - - ba3b97bf by Andreas Tille at 2026-11-04T09:15:48+01:00 skip-32bit-tests.patch: skip the 64-bit object-size checks and the PileupColumn access-after-iterator test on 32-bit platforms. Closes: #1152973 - - - - - 4 changed files: - debian/changelog - debian/patches/faidx-stdout.patch - debian/patches/series - + debian/patches/skip-32bit-tests.patch Changes: ===================================== debian/changelog ===================================== @@ -1,11 +1,8 @@ python-pysam (0.24.1+ds-3) UNRELEASED; urgency=medium - * Fix pysam.faidx() returning an empty string with samtools >= 1.22 - TODO Review! - This patch was assisted by https://inference.debian.net/ Model DeepSeek V4 Flash 0731 - in response to - https://github.com/sanger-pathogens/ariba/issues/349#issuecomment-5774347302 - It needs human review before it can be applied. + * skip-32bit-tests.patch: skip the 64-bit object-size checks + and the PileupColumn access-after-iterator test on 32-bit platforms. + Closes: #1152973 -- Andreas Tille <[email protected]> Wed, 23 Sep 2026 07:01:37 +0200 ===================================== debian/patches/faidx-stdout.patch ===================================== @@ -12,9 +12,10 @@ Description: Fix pysam.faidx() returning an empty string with samtools >= 1.22 Add regression tests for the returned wrapped sequence, multiple regions, and index-only invocations. Author: Andreas Tille <[email protected]> - assisted by https://inference.debian.net/ Model DeepSeek V4 Flash 0731 +Assisted-By: https://inference.debian.net/ Model DeepSeek V4 Flash 0731 Forwarded: no Last-Update: 2026-09-22 +Comment: Needs review, not applied yet --- a/pysam/libcutils.pyx +++ b/pysam/libcutils.pyx ===================================== debian/patches/series ===================================== @@ -1,3 +1,5 @@ # skip_test_remote.patch clean_less -faidx-stdout.patch +# faidx-stdout.patch # needs human review first +skip-32bit-tests.patch + ===================================== debian/patches/skip-32bit-tests.patch ===================================== @@ -0,0 +1,67 @@ +Description: Skip tests that are invalid or crash on 32-bit platforms + TestBinaryCompatibility compares hard-coded object sizes of the 64-bit + layouts, and testIteratorOutOfScope deliberately accesses a PileupColumn + after its iterator is gone, which is a use-after-free in pysam that + typically crashes rather than raising on 32-bit platforms (see + https://github.com/pysam-developers/pysam/issues/1151). + Upstream guards these with platform.machine(), but that reports the + kernel architecture: on i386 builds on a 64-bit kernel it still returns + x86_64, so the guard does not take effect and both test sets fail or + crash, breaking the build on i386, armhf and any other 32-bit arch. + Key both guards on the pointer size of the interpreter running the + tests instead. +Author: Andreas Tille <[email protected]> +Bug-Debian: https://bugs.debian.org/1152973 +Forwarded: https://github.com/pysam-developers/pysam/issues/1151 +Assisted-By: scaleway/deepseek-v4-flash-0731 + +diff --git a/tests/AlignmentFilePileup_test.py b/tests/AlignmentFilePileup_test.py +index 0969231..64a13fc 100644 +--- a/tests/AlignmentFilePileup_test.py ++++ b/tests/AlignmentFilePileup_test.py +@@ -1,6 +1,7 @@ + """Benchmarking module for AlignmentFile functionality""" + import os + import pysam ++import struct + import sys + import pytest + +@@ -174,8 +175,10 @@ class TestPileupObjects: + def teardown_method(self): + self.samfile.close() + +- @pytest.mark.skipif(sys.version_info[:2] == (3, 11) or sys.platform.startswith("netbsd"), +- reason="exercises invalid accesses, which crashes on Python 3.11 and NetBSD") ++ @pytest.mark.skipif(struct.calcsize("P") < 8 ++ or sys.version_info[:2] == (3, 11) ++ or sys.platform.startswith("netbsd"), ++ reason="exercises invalid accesses, which crashes on 32-bit platforms, Python 3.11 and NetBSD") + def testIteratorOutOfScope(self): + '''test if exception is raised if pileup col is accessed after + iterator is exhausted.''' +diff --git a/tests/compile_test.py b/tests/compile_test.py +index fbb8760..ddd0873 100644 +--- a/tests/compile_test.py ++++ b/tests/compile_test.py +@@ -8,7 +8,7 @@ pysam and tabix works. + + # clean up previous compilation + import os +-import platform ++import struct + import pytest + import pysam + from TestUtils import make_data_files, BAM_DATADIR, CBCF_DATADIR, TABIX_DATADIR +@@ -54,7 +54,10 @@ def test_gtf(): + assert nread == 237 + + [email protected](platform.machine() not in ('aarch64', 'arm64', 'AMD64', 'x86_64'), reason="different scalar sizes") ++# Scalar sizes differ on 32-bit platforms. platform.machine() reports the ++# kernel architecture, which is still x86_64 in a 32-bit i386 chroot, so ++# check the pointer size of the interpreter actually running the test. [email protected](struct.calcsize("P") < 8, reason="different scalar sizes") + class TestBinaryCompatibility: + def test_alignments(self): + fp = pysam.AlignmentFile(os.path.join(BAM_DATADIR, "ex1.bam")) View it on GitLab: https://salsa.debian.org/med-team/python-pysam/-/compare/78442077b16be152c4509c3f5b5f81d1be1ab3af...ba3b97bf7b7440475cadb8776e16ce3f349ffe5b -- View it on GitLab: https://salsa.debian.org/med-team/python-pysam/-/compare/78442077b16be152c4509c3f5b5f81d1be1ab3af...ba3b97bf7b7440475cadb8776e16ce3f349ffe5b You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help
_______________________________________________ debian-med-commit mailing list [email protected] https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/debian-med-commit
