-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
my application using ctypes crashes on Kivy 1.9.2 and not on 1.8 #858
Comments
Additional info: |
This may be an issue with the python distribution itself. It is likely the python distribution being used is using 'malloc' instead of 'mmap' for its 'ffi_closure_alloc/free' function which is called by '_ctypes_alloc_callback'. Android's malloc does not grant PROT_EXEC to allocated memory, which is necessary for the python code to be called. It may be as easy as using the implementation in the file 'malloc_closure.c'. |
Thanks for your comment. Does it be mean that I will need to update the python distribution for android? I am quite new in the Kivy world, so i will likely need step by step help here:-). In past we could build the distribution with the build script. Now it seems that we can get the hole package through an exe. I don't see how the modify a particular file. Any idea why to update a exiting python distribution for android? |
Closing as stale, I'm not aware of any issue like this on the master branch. |
Hi,
I would like to share an issue i am getting while building an APK using the latest python-for-android package (1.9.x). The same code works fine on an old version of Kivy (1.8.).
I will try to describe how i get to this and please let me know if more clarification is needed:
Basically the code consists of (mydll.c):
`
typedef int (*callback_type)(float, float);
DLLEXPORT int our_callback(callback_type callbackHandler)
{
float a = 10;
float b = 50;
float count = 0;
for (count=0; count<60;count=count+10)
{
(*(callbackHandler))((a+count),b);
}
return 0;
`
`
callback_type = CFUNCTYPE(c_int, c_float, c_float)
if name == 'main':
`
Find attached the complete files:
python_ctype.zip
This works perfectly on PC (win32) and on android when using Kivy 1.8.
But when i build an APK using Kivy 1.9, i am getting a crash in the c library when referring to the callback (see the attached log file retrieved from logcat).
log_python4android_Kivy1.9_crash.txt
I used the following command:
python-for-android create --dist_name=batch2 --bootstrap=pygame -- requirements=hostpython2,python2,pyjnius,sdl,pygame,android,kivy
I am running out of ideas here and wondering what could have changed between 1.8 and 1.9?
Am i doing something wrong? or could it be that i am missing some modules?
I've checked the Cython version, i am using 0.23.
Let me know if you need more info.
Any help would be highly appreciated:-).
Thanks in advance.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: