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

Trupti trupti at linux.ibm.com
Wed Sep 16 08:31:19 BST 2026


On 2026-09-16 12:45, John Paul Adrian Glaubitz wrote:
> Hi Trupti,
> 
> On Wed, 2026-09-16 at 12:39 +0530, Trupti wrote:
>> This is issue is reproducible on debian powerpc system and I am 
>> working
>> on this issue.
> 
> Much appreciated, thanks a lot! At least one positive news for me this 
> week!
> 
> Adrian


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



More information about the debian-science-maintainers mailing list