This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: ctypes: callback from C++ to Python fails with Illegal Instruction call
Type: crash Stage: resolved
Components: ctypes Versions: Python 2.7
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: Opilki_Inside, asvetlov, jcea, r.david.murray, wiggin15
Priority: normal Keywords: patch

Created on 2012-09-26 00:22 by Opilki_Inside, last changed 2022-04-11 14:57 by admin. This issue is now closed.

File name Uploaded Description Edit
soft_float.patch Opilki_Inside, 2012-09-26 00:22 patch that support _SOFT_FLOAT flag along with __NO_FPRS__ review
Messages (4)
msg171325 - (view) Author: Pavel Maltsev (Opilki_Inside) Date: 2012-09-26 00:22
ppc_405, Linux 2.4, GCC 3.3.1

Python crashes on attempt to pass python callback function to custom C++ library under PowerPC 405. This happens because some versions of GCC (I guess below 4.1) doesn't raise __NO_FPRS__ flag if hard-floats is not supported, instead they use _SOFT_FLOAT. So we need to change

#ifndef __NO_FPRS__
#if (!defined(__NO_FPRS__) && !defined(_SOFT_FLOAT))
msg171422 - (view) Author: Jesús Cea Avión (jcea) * (Python committer) Date: 2012-09-28 09:24
Pavel, I think the FFI we use is a direct copy of libffi. Could you contact upstream?.
msg240627 - (view) Author: Arnon Yaari (wiggin15) * Date: 2015-04-13 15:42
libffi seem to have fixed this issue in their commit "4acf005 - Build fix for soft-float power targets". The fix is different than what Pavel suggested, but sounds like it should do the same.
msg240678 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2015-04-13 17:38
Arnon also checked that our local copy of libffi contains the upstream fix.  In the absence of a way to test this, we'll just have to assume it is fixed.
Date User Action Args
2022-04-11 14:57:36adminsetgithub: 60254
2015-04-13 17:38:00r.david.murraysetstatus: open -> closed

nosy: + r.david.murray
messages: + msg240678

resolution: out of date
stage: resolved
2015-04-13 15:42:17wiggin15setnosy: + wiggin15
messages: + msg240627
2012-10-07 12:30:30asvetlovsetnosy: + asvetlov
2012-09-28 09:24:33jceasetnosy: + jcea
messages: + msg171422
2012-09-26 00:22:14Opilki_Insidecreate