Your message dated Sun, 18 Oct 2026 15:50:18 +0000
with message-id <[email protected]>
and subject line Bug#1146590: fixed in tinyarray 1.2.5-2
has caused the Debian Bug report #1146590,
regarding tinyarray: FTBFS on arm64
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
1146590: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1146590
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: src:tinyarray
Version: 1.2.5-1
User: [email protected]
Usertags: python3.15
Tags: patch, ftbfs, forky, sid

Hi!

While rebuilding the python related packages against the Python 3.15rc1
version we found that tinyarray fails to build from source on arm64 [1].
This also fails on Debian's buildds [2].

It fails in arm64 with: Failed: DID NOT RAISE OverflowError

When converting floats to integer, `std::numeric_limits<long>::max()`
(2^63 - 1) rounds up to 2^63 in float/double, causing `*ptr > max()` to
be false for 2^63. The subsequent check on the cast integer relied on
architecture-specific overflow behavior that does not hold on ARM64
(where out-of-range floats saturate to positive INT64_MAX instead of
negative values).

So, to fix it, check bounds against exact power-of-two limits before
casting to detect  overflow portably across architectures.

I applied the fix in the sandbox [3] to be able to build the packages
that depend on tinyarray, please consider applying the patch to support
the upcoming 3.15 version.

Happy hacking,

[1]: https://debusine.debian.net/debian/r-python-python3.15/artifact/4316397/
[2]: 
https://buildd.debian.org/status/fetch.php?pkg=tinyarray&arch=arm64&ver=1.2.5-1&stamp=1766523038&raw=0
[3]: https://debusine.debian.net/debian/r-python-python3.15/

--
"Can you imagine what I would do if I could do all I can?" -- Sun Tzu
Saludos /\/\ /\ >< `/
Description: Fix float-to-integer overflow detection across architectures
 When converting floats to integer, std::numeric_limits<long>::max() (2^63 - 1)
 rounds up to 2^63 in float/double, causing *ptr > max() to be false for 2^63.
 The subsequent check on the cast integer relied on architecture-specific
 overflow behavior that does not hold on ARM64 (where out-of-range floats
 saturate to positive INT64_MAX instead of negative values).
 .
 Check bounds against exact power-of-two limits before casting to detect
 overflow portably across architectures.
Author: Maximiliano Curia <[email protected]>
diff --git a/src/conversion.hh b/src/conversion.hh
index bb7de89..7da9563 100644
--- a/src/conversion.hh
+++ b/src/conversion.hh
@@ -177,22 +177,18 @@ inline long number_from_ptr<long, unsigned long long>(const void *data)
 template<typename Tdest, typename Tsrc>
 inline Tdest _int_from_floatptr_exact(const void *data)
 {
-    const Tsrc *ptr = reinterpret_cast<const Tsrc*>(data);
-    Tdest result = static_cast<Tdest>(*ptr);
-
-    // Note: the > max and < min tests are unreliable since the floating point
-    // representation of the maximal/minimal value may not be exact. The two
-    // other tests catch these problems.  This approach looks flimsy and is
-    // implementation-dependent, but it is tested rigourosly.
-    if (*ptr > std::numeric_limits<Tdest>::max() ||
-        *ptr < std::numeric_limits<Tdest>::min() ||
-        (*ptr > 0 && result < 0) || (*ptr < 0 && result > 0)) {
+    const Tsrc val = *reinterpret_cast<const Tsrc*>(data);
+    const Tsrc min_val = static_cast<Tsrc>(std::numeric_limits<Tdest>::min());
+    const Tsrc max_val_plus_1 = -min_val;
+    const Tsrc min_minus_1 = min_val - static_cast<Tsrc>(1);
+    const bool underflow = (min_minus_1 < min_val) ? (val <= min_minus_1) : (val < min_val);
+
+    if (!(val < max_val_plus_1) || underflow) {
         PyErr_Format(PyExc_OverflowError,
                      "Float too large to be represented by long");
         return -1;
-    } else
-    {
-        return result;
+    } else {
+        return static_cast<Tdest>(val);
     }
 }
 

--- End Message ---
--- Begin Message ---
Source: tinyarray
Source-Version: 1.2.5-2
Done: Margarita Manterola <[email protected]>

We believe that the bug you reported is fixed in the latest version of
tinyarray, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Margarita Manterola <[email protected]> (supplier of updated tinyarray package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Sun, 18 Oct 2026 14:09:13 +0200
Source: tinyarray
Architecture: source
Version: 1.2.5-2
Distribution: unstable
Urgency: medium
Maintainer: Debian Python Team <[email protected]>
Changed-By: Margarita Manterola <[email protected]>
Closes: 1017051 1146590
Changes:
 tinyarray (1.2.5-2) unstable; urgency=medium
 .
   * Team upload.
   * Add fix-float-to-integer-conversion.patch to fix missing overflow error on
     several non-amd64 architectures (Closes: #1146590).
   * Add fix-32bit-integer-hash.patch to fix wrong hash values for certain
     numbers on 32bit architectures (Closes: #1017051).
   * Add fix-armhf-alignment.patch to solve alignment issuees on armhf and
     possibly other architectures.
   * Update Standards-Version to 4.7.4: drop Priority field from
     debian/control.
Checksums-Sha1:
 6700fbe65619ca18b66afb0c1e6f0673c9650838 2349 tinyarray_1.2.5-2.dsc
 3ed671d06a0cdc0bd82edbea7380ba576959e0d1 38510 tinyarray_1.2.5.orig.tar.gz
 d5808b5c016e8cd867259f04404d98b139cd44b3 833 tinyarray_1.2.5.orig.tar.gz.asc
 43ed5ecb1e4bc130472eb7e2e96a0b94ac4b213a 9920 tinyarray_1.2.5-2.debian.tar.xz
 94e30688882ceda38340ae1acfe4a862c2994c1f 6701 
tinyarray_1.2.5-2_source.buildinfo
Checksums-Sha256:
 8e402d770a3645d32de3dc568c703d2d73983ff04bce22f126204db04202bea0 2349 
tinyarray_1.2.5-2.dsc
 5d47b3d475a30478ee72d6afe238c3d3683b3a3f9d425bb2f6384270b2c8799b 38510 
tinyarray_1.2.5.orig.tar.gz
 4e6b8b9697d113369ad957658a4a2a4f342a3e673bd2e0431ff2bca958c09230 833 
tinyarray_1.2.5.orig.tar.gz.asc
 fc827c1f458ad19a3c71ced067cf713e664449e8202194d69db177c19c611c05 9920 
tinyarray_1.2.5-2.debian.tar.xz
 9aec62c0522225aa9d28849e016c31d1f69ca80b7eb3f97bf2828554c10c1493 6701 
tinyarray_1.2.5-2_source.buildinfo
Files:
 23dcb2cda69ca5849f0652519a901ee4 2349 python optional tinyarray_1.2.5-2.dsc
 06cbd64dd59c764482c1c4eba9994434 38510 python optional 
tinyarray_1.2.5.orig.tar.gz
 8ca37c5847171984b19ec38ae5d13c31 833 python optional 
tinyarray_1.2.5.orig.tar.gz.asc
 70b34dc64e40c996568aa88f0ebfd3d6 9920 python optional 
tinyarray_1.2.5-2.debian.tar.xz
 66aea2c142af182f343a6c140859d3fa 6701 python optional 
tinyarray_1.2.5-2_source.buildinfo

-----BEGIN PGP SIGNATURE-----

iQJFBAEBCgAvFiEEAMPhhOivEnEYVt/SgNCkL/LIUMoFAmrU48wRHG1hcmdhQGRl
Ymlhbi5vcmcACgkQgNCkL/LIUMqHwg//fhV3C0/rmxWXnj3hMDRLYWp3rufh7VME
hr61UyWyNLl1q/v8On31/aTt54U/d4A+vnTNph0LXeMxpd3xvFVb98NkM+KYpvbA
Jw99VDk1QWWc3plsPiZBjVbu6QtdKEG/ecNb2fsJnn/dBRShzNAdXy7xvnUrTP6o
y6EN9FVC9AQWNV2IkQw2G3DrE11yGNP0mrMY7SaWUmy/f/Ipa35rvsYtKdu5Rdmy
PONnngrdrz9JQ8HTZ72PpL6YPo9ehPD49/RixyNM2hVHlSnq0AHYIV79J0dy/Fbt
iw4VAE1oDYF+vAMLAsvq/aqiVAxx9JjrUs9f+VtMZsJuYWUScWT0YER1pVu6N6zW
dPNRpfjJ2m8UeN617gxHRs0+sXUr4B+TETJY1/o2lnVtoOylKJ4CSpnkJbCyzbWI
0fO5iHWXm+gXfbHQdATZG1df1SRNcquIGTKw3mzFyUjdfx71fYQg1t+7MOeVE7BR
SoIKXSkngD0P8urfaQ8yaRkj0jhtOyK4De7BmUIhTQPrFxa2AFmM4EBKG4QvKmmi
ioNZYd8Dv4n7WT6aXz6ATDHZN875yQSq9CqbSnvhU5UD5WHzo+xgbMsB/+Lfxwbu
DKaPmZIeH86GUIscUJAwrB+vbOI5zk8bqenoZm/KBnAplVdc36EqiXaZp1eCAxpH
oihC30wiCMc=
=zBCn
-----END PGP SIGNATURE-----

Attachment: pgpNhnWTjjkmE.pgp
Description: PGP signature


--- End Message ---

Reply via email to