#1148010 pandas: FTBFS on powerpc - skiprows callable always receives 0

#1148010#5
Date:
2026-09-16 07:09:39 UTC
From:
To:
Source: pandas
Version: 2.3.3+dfsg-4
Severity: serious
Tags: ftbfs, forky, sid
Justification: fails to build from source
User: debian-powerpc@lists.debian.org
Usertags: powerpc
X-Debbugs-Cc: debian-powerpc@lists.debian.org,
glaubitz@physik.fu-berlin.de,
debian-science-maintainers@lists.alioth.debian.org

Hi,

pandas 2.3.3+dfsg-4 fails to build from source on powerpc.
8 tests fail in tests/io/parser/test_skiprows.py:


=========================== short test summary info
============================
FAILED
pandas/tests/io/parser/test_skiprows.py::test_skip_rows_callable[c_high-kwargs0-expected0]
FAILED
pandas/tests/io/parser/test_skiprows.py::test_skip_rows_callable[c_high-kwargs1-expected1]
FAILED
pandas/tests/io/parser/test_skiprows.py::test_skip_rows_callable[c_low-kwargs0-expected0]
FAILED
pandas/tests/io/parser/test_skiprows.py::test_skip_rows_callable[c_low-kwargs1-expected1]
FAILED
pandas/tests/io/parser/test_skiprows.py::test_skip_rows_callable_not_in[c_high]
FAILED
pandas/tests/io/parser/test_skiprows.py::test_skip_rows_callable_not_in[c_low]
FAILED
pandas/tests/io/parser/test_skiprows.py::test_skip_rows_with_chunks[c_high]
FAILED
pandas/tests/io/parser/test_skiprows.py::test_skip_rows_with_chunks[c_low]
= 8 failed, 10537 passed, 3424 skipped, 296 deselected, 136 xfailed, 600
xpassed, 7 warnings in 172.83s (0:02:52) =
rdjoqkol test state = false


Build log:
https://buildd.debian.org/status/fetch.php?pkg=pandas&arch=powerpc&ver=2.3.3%2Bdfsg-4&stamp=1789429838&raw=0


This is issue is reproducible on debian powerpc system and I am working
on this issue.


Thanks,
Trupti

#1148010#10
Date:
2026-09-16 07:15:43 UTC
From:
To:
Hi Trupti,

Much appreciated, thanks a lot! At least one positive news for me this week!

Adrian

#1148010#15
Date:
2026-09-16 07:31:19 UTC
From:
To:
Hi,

Thanks to you Adrin for pointing out these issues on power system.


I investigated the root cause and have a fix ready.

Root cause:
===========
In pandas/_libs/src/parser/tokenizer.c, skip_this_line() calls:

   PyObject_CallFunction(self->skipfunc, "i", rownum);

where rownum is int64_t (64-bit) but "i" tells CPython to read a C int
(32-bit). On 32-bit big-endian powerpc, int64_t is passed
as two 32-bit registers. CPython reads the first register (the high
word), which is always 0x00000000 for any normal row number. So the
callable always receives 0.


Suggested Fix:

Use "L" (long long, 64-bit) with explicit cast:
--- a/pandas/_libs/src/parser/tokenizer.c
+++ b/pandas/_libs/src/parser/tokenizer.c
@@ -647,7 +647,7 @@ static int skip_this_line(parser_t *self, int64_t
rownum) {
    if (self->skipfunc != NULL) {
      PyGILState_STATE state = PyGILState_Ensure();
-    PyObject *result = PyObject_CallFunction(self->skipfunc, "i",
rownum);
+    PyObject *result = PyObject_CallFunction(self->skipfunc, "L", (long
long)rownum);


Verification:


   After applying this patch pandas built successfully on debian powerpc
with sbuild on ppc64 machine.
   powerpc: 8 failures -> 0 failures with patch


Adrian, is this the correct approach? Do you have any suggestions before
I move forward?


Thanks,
Trupti

#1148010#20
Date:
2026-09-16 07:58:50 UTC
From:
To:
Hi Trupti,

What about explicitly declaring "rownum" as long long in order to avoid
the cast?

int64_t rownum;
PyObject *result = PyObject_CallFunction(self->skipfunc, "L", rownum);

Either way, I suggest you send the pull request upstream and see what
they prefer.

Thanks a lot for fixing this!

Adrian

#1148010#25
Date:
2026-09-16 08:10:44 UTC
From:
To:

Hi Adrian,

Thank you for the review and suggestion!

I will send the pull request upstream with both approaches mentioned
and let the pandas maintainers decide which they prefer.

Once upstream accepts it I will update the Debian patch accordingly.


Thanks,
Trupti

#1148010#30
Date:
2026-09-16 21:49:08 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
pandas, 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 1148010@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Rebecca N. Palmer <rebecca_palmer@zoho.com> (supplier of updated pandas 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 ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Wed, 16 Sep 2026 20:30:23 +0100
Source: pandas
Architecture: source
Version: 2.3.3+dfsg-5
Distribution: unstable
Urgency: medium
Maintainer: Debian Science Maintainers <debian-science-maintainers@lists.alioth.debian.org>
Changed-By: Rebecca N. Palmer <rebecca_palmer@zoho.com>
Closes: 1144864 1148010
Changes:
 pandas (2.3.3+dfsg-5) unstable; urgency=medium
 .
   * Be compatible with Python 3.15. (Closes: #1144864)
   * Reduce numerical instability in rolling var/skew/kurt.
   * Use 64-bit type in skiprows. (Closes: #1148010)
Checksums-Sha1:
 1c30c1e9c3c2712e8c5cffad115e379a28da2322 5624 pandas_2.3.3+dfsg-5.dsc
 98cd00cb06b7b783c7988bce026b3cdab653a546 121552 pandas_2.3.3+dfsg-5.debian.tar.xz
 5bb176954dd0c6d66bb2e1e5a93ce1f514fcb19c 10123 pandas_2.3.3+dfsg-5_source.buildinfo
Checksums-Sha256:
 ab3999f2260984471dadaaafe283c9bd2c27807f4dba5548f41ec6f400c26fd4 5624 pandas_2.3.3+dfsg-5.dsc
 2a5657149fef567093c74eb07e1fddf6119a3a22c53a0eeb2e4d32372f3b41e4 121552 pandas_2.3.3+dfsg-5.debian.tar.xz
 ccfac76017e04900f0822f3900c9881a3e80c60d19c3ddcbc74c1fa7accec7f6 10123 pandas_2.3.3+dfsg-5_source.buildinfo
Files:
 f2bba7d14ee49e120ac84dfef1926011 5624 python optional pandas_2.3.3+dfsg-5.dsc
 cdf677bc8a0efef6251929aa8b3c1c25 121552 python optional pandas_2.3.3+dfsg-5.debian.tar.xz
 6380aa96ab0b53bf9c9865644685838f 10123 python optional pandas_2.3.3+dfsg-5_source.buildinfo
-----BEGIN PGP SIGNATURE-----

iQJMBAEBCgA2FiEEZ8sxEAXE7b4yF1MI3uUNDVZ+omYFAmqrAlEYHHJlYmVjY2Ff
cGFsbWVyQHpvaG8uY29tAAoJEN7lDQ1WfqJmPFkP/3lOe/gGWD1AUtjnuvRW5mNn
2eqNJQOldhXkSdeh5gVbB83bIn2vTg5hlqxHUO3anIwP+xVHrZFEx9BQ3GA4oqz1
8WSzxRSfaiFJHZcqjIn+NgLCYtGwLi3+SVa6LJfYVsYRMQFLPbX8dijwoYjS9UgO
HS2k5VpKQgye2ddmiOkXg3k0LgQ+IrXftth1MozqxkhrcrzRPirAiCyvVOmulNVI
0y/1q3bTpD+ervKWnbKi6kbiG+gb8Gh0A7h2HA7dqUrDJXmj43/L0d/vU45nPhLA
o6kFgzFw2maJih3sTlf+N5NSZGJA1p5x5czNCZDvUgvbQKiKYEe5QiSGMtbv+Z/P
EHSqlcE/l5C6M/SmPR8JIZmU5IYuO40xnZwxbMYXxzekEKu2bIE6rZoOuqIbyiXg
X1dXsK7NHL7FnKVYOjvy7WPmISxY1HYAqdLGi2j0C78e2SHjfybzcoVMTSSYFAWV
pzgHeBPFuGv/d/HBZCiuMHzdnLVozFRYSf5VmdlnvWfAKg7HzIUz1J6kIEx0Qqh3
jFu7y2S3wje/NSK3nKJWzl1bb5mQE2sg4RBfpObQIjknQiaXkFboMrnaVYyrngLE
TME9XviQvHCufUjpLa86qtmzhb20B8pP3pW19vUIDJD5GkNn/KNGoYOVqf/AN74k
92GXPlM9Cp4wnABEr9B5
=W4G+
-----END PGP SIGNATURE-----

#1148010#35
Date:
2026-10-01 14:51:23 UTC
From:
To:
Hi Adrian,

As mentioned above, I have raised a PR upstream to fix the pandas issue
on PowerPC and it is currently under review.

Reference:
(https://github.com/pandas-dev/pandas/pull/69985)


Thanks,
Trupti