This issue affects C functions with many float/double arguments called through ctypes on ARM using the hardfloat ABI (i.e. the standard distribution for the raspberry pi uses hard-float). Calling a C function using ctypes on ARM hard-float that takes a large number of float arguments (more than 16 floats or more than 8 doubles) corrupts the first float/double arguments passed on the stack to the called function. To check the issue run the following commands on an ARM hard-float system: make python bug.py A patch for this issue has been accepted into libffi.
Apparently you can't have an opinion from ctypes experts. Can you please commit the upstream fix that has been committed 3 years ago or just stop vendoring random, old, broken version of ctypes if you can't maintain it enough to pull fixes from upstream?
To me, it doesn't make sense to maintain a downstream "fork" of libffi. I would prefer to "simply" upgrade to a more recent version of libffi in CPython. But I don't know why we have a downstream version. What was patched? Does anyone know anything about it? I understood that Linux packages configure with ./configure --with-system-libffi to reuse the system libffi.so. Who uses the downstream version? Windows? OS X?
David Schneider: "A patch for this issue has been accepted into libffi." fijal: "Can you please commit the upstream fix that has been committed 3 years ago (...)" Which patch? Attached tar archive doesn't look like a patch and I see no reference to a fix. Previous libffi upgrade: --- changeset: 92061:4331fa01398e branch: 2.7 parent: 92058:928135d0fa7d user: doko@ubuntu.com date: Sun Aug 10 11:15:28 2014 +0200 files: Misc/NEWSModules/_ctypes/libffi.diffModules/_ctypes/libffi/.gitignoreModules/_ctypes/libffi/.travis.ymlModules/_ctypes/libffi/ChangeLogModules/_ctypes/libffi/Change description: - Issue #22176: Update the ctypes module's libffi to v3.1. This release adds support for the Linux AArch64 and POWERPC ELF ABIv2 little endian architectures. --- This upgrade was made in august 2014, this issue was reported in march 2013. The upgrade didn't add the mentioned fix?