[med-svn] [Git][med-team/python-bx][master] Add patch for off by one error on 32 bit systems

Michael R. Crusoe gitlab at salsa.debian.org
Wed Dec 18 11:31:39 GMT 2019



Michael R. Crusoe pushed to branch master at Debian Med / python-bx


Commits:
6149737a by Michael R. Crusoe at 2019-12-18T11:23:49Z
Add patch for off by one error on 32 bit systems

- - - - -


4 changed files:

- debian/changelog
- + debian/patches/fix_BIN_OFFSETS_MAX
- debian/patches/series
- debian/rules


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,10 @@
+python-bx (0.8.6-2) unstable; urgency=medium
+
+  * Team upload.
+  * Add patch for errors on 32 bit systems. Closes: #944409
+
+ -- Michael R. Crusoe <michael.crusoe at gmail.com>  Wed, 18 Dec 2019 12:23:30 +0100
+
 python-bx (0.8.6-1) unstable; urgency=medium
 
   * Team upload.


=====================================
debian/patches/fix_BIN_OFFSETS_MAX
=====================================
@@ -0,0 +1,32 @@
+From: Michael R. Crusoe <michael.crusoe at gmail.com>
+Subject: fix error for 32bit systems
+--- python-bx.orig/lib/bx/interval_index_file.py
++++ python-bx/lib/bx/interval_index_file.py
+@@ -125,7 +125,7 @@
+     BIN_OFFSETS_MAX.insert(0, (BIN_OFFSETS_MAX[0] << BIN_NEXT_SHIFT))
+ # The maximum size for the top bin is actually bigger than the signed integers
+ # we use to store positions in the file, so we'll change it to prevent confusion
+-BIN_OFFSETS_MAX[0] = sys.maxsize
++BIN_OFFSETS_MAX[0] = 2**63
+ 
+ # Constants for the minimum and maximum size of the overall interval
+ MIN = 0
+@@ -138,12 +138,14 @@
+     """
+     Return the subset of offsets needed to contain intervals over (0,max_size)
+     """
+-    for i, max in enumerate(reversed(BIN_OFFSETS_MAX)):
+-        if max_size < max:
++    offset_index = None
++    for i, off_max in enumerate(reversed(BIN_OFFSETS_MAX)):
++        if max_size <= off_max:
++            offset_index = i
+             break
+-    else:
++    if offset_index is None:
+         raise Exception("%d is larger than the maximum possible size (%d)" % (max_size, BIN_OFFSETS_MAX[0]))
+-    return BIN_OFFSETS[(len(BIN_OFFSETS) - i - 1):]
++    return BIN_OFFSETS[(len(BIN_OFFSETS) - offset_index - 1):]
+ 
+ 
+ def bin_for_range(start, end, offsets=None):


=====================================
debian/patches/series
=====================================
@@ -1 +1,2 @@
 no-download.patch
+fix_BIN_OFFSETS_MAX


=====================================
debian/rules
=====================================
@@ -11,11 +11,6 @@ export PYBUILD_BEFORE_TEST=cp -r {dir}/test_data {build_dir}/
 
 export DEB_BUILD_MAINT_OPTIONS=hardening=+all
 
-include /usr/share/dpkg/architecture.mk
-ifneq (,$(filter i386,$(DEB_BUILD_ARCH)))
-	export PYBUILD_TEST_ARGS=-e test_interval_index_file
-endif
-
 %:
 	dh $@ --with python3 --buildsystem=pybuild
 



View it on GitLab: https://salsa.debian.org/med-team/python-bx/commit/6149737aa88777b302bb01aada0ac0e3de37dca1

-- 
View it on GitLab: https://salsa.debian.org/med-team/python-bx/commit/6149737aa88777b302bb01aada0ac0e3de37dca1
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20191218/07c18617/attachment-0001.html>


More information about the debian-med-commit mailing list