Turns out that there is an issue with returning the original input from the same address that PyArg_ParseTupl e stores the parameter in.
If I convert the PyObject to a PyObjectArray (as below) and always return that array instead of the original input (earlier, my code was returning the original input when no changes were necessary), then the function does not throw the segmentation fault that I was getting earlier.
The code...
User Profile
Collapse
-
Return from C extension throws segmentation fault
Hi all,
I have been making a C extension to Python recently. This extension has a function that takes a 3D array (as made by pygame.surfarra y.pixels3d), is going to do operations on this array, and then return it.
My problem is, that the most basic form of this function is throwing a segmentation fault after 58 calls from my program. The input is always a 3D array of integers, 1st dimension of size 70, second of size...
No activity results to display
Show More
Leave a comment: