Skip to content

CFFI android crash pycryptodomex #3238

Closed

Description

@CluckyMedia

Recently getting cffi crash bug when referencing Cryptodome.Cipher classes. Not sure is this has been been recently introduced and/or is a known issue? It was working a couple of weeks ago.

10-18 13:18:36.402 9707 9844 I python : Traceback (most recent call last):
10-18 13:18:36.402 9707 9844 I python : File "/home/runner/work/app/.buildozer/android/platform/build-arm64-v8a/build/python-installs/app/arm64-v8a/Cryptodome/Util/_raw_api.py", line 77, in
10-18 13:18:36.402 9707 9844 I python : ImportError: CFFI with optimize=2 fails due to pycparser bug.
10-18 13:18:36.402 9707 9844 I python :
10-18 13:18:36.402 9707 9844 I python : During handling of the above exception, another exception occurred:
10-18 13:18:36.402 9707 9844 I python :
10-18 13:18:36.403 9707 9844 I python : Traceback (most recent call last):
10-18 13:18:36.403 9707 9844 I python : File "/home/runner/work/app/.buildozer/android/app/main.py", line 8, in
10-18 13:18:36.403 9707 9844 I python : File "/home/runner/work/app/.buildozer/android/app/utils/helpers.py", line 10, in
10-18 13:18:36.403 9707 9844 I python : File "/home/runner/work/app/.buildozer/android/platform/build-arm64-v8a/build/python-installs/app/arm64-v8a/Cryptodome/Cipher/AES.py", line 26, in
10-18 13:18:36.403 9707 9844 I python : File "/home/runner/work/app/.buildozer/android/platform/build-arm64-v8a/build/python-installs/app/arm64-v8a/Cryptodome/Util/_raw_api.py", line 209, in
10-18 13:18:36.403 9707 9844 I python : File "/home/runner/work/app/.buildozer/android/platform/build-arm64-v8a/build/other_builds/python3/arm64-v8a__ndk_target_26/python3/Lib/ctypes/init.py", line 389, in getattr
10-18 13:18:36.404 9707 9844 I python : File "/home/runner/work/app/.buildozer/android/platform/build-arm64-v8a/build/other_builds/python3/arm64-v8a__ndk_target_26/python3/Lib/ctypes/init.py", line 394, in getitem
10-18 13:18:36.404 9707 9844 I python : AttributeError: undefined symbol: PyObject_GetBuffer
10-18 13:18:36.404 9707 9844 I python : Python for android ended.

Activity

  1. T-Dynamos commented on Oct 26, 2025

    @T-Dynamos
    Member

    @CluckyMedia Can you reproduce the issue with #3233 ?

  2. CluckyMedia commented on Oct 27, 2025

    @CluckyMedia
    Author

    Sorry for the delay. No, not in regards to the above traceback log but now I get a Module Not Found crash for pycryptodome (Crypto.Util.Number):

    Traceback (most recent call last):
    10-27 19:36:48.833 24279 24386 I python : File "/home/runner/work/app/.buildozer/android/app/main.py", line 8, in
    10-27 19:36:48.834 24279 24386 I python : File "/home/runner/work/app/.buildozer/android/app/utils/helpers.py", line 10, in
    10-27 19:36:48.834 24279 24386 I python : File "/home/runner/work/app/.buildozer/android/platform/build-arm64-v8a/build/python-installs/app/arm64-v8a/Crypto/Cipher/init.py", line 31, in
    10-27 19:36:48.834 24279 24386 I python : File "/home/runner/work/app/.buildozer/android/platform/build-arm64-v8a/build/python-installs/app/arm64-v8a/Crypto/Cipher/_mode_ctr.py", line 37, in
    10-27 19:36:48.835 24279 24386 I python : ModuleNotFoundError: No module named 'Crypto.Util.number'
    10-27 19:36:48.835 24279 24386 I python : Python for android ended.
    10-27 19:36:49.461 24279 24386 D RefBase : #2 pc 000000000034121c /data/app/_jYhZrTezw6yMwi0NrcmfA==/com.cluckymedia.app-g06gV9QUYz7uYQn9aKPAOw==/lib/arm64/libpython3.11.so (Py_Exit+32)
    10-27 19:36:49.461 24279 24386 D RefBase : #3 pc 0000000000347274 /data/app/
    _jYhZrTezw6yMwi0NrcmfA==/com.cluckymedia.app-g06gV9QUYz7uYQn9aKPAOw==/lib/arm64/libpython3.11.so
    10-27 19:36:49.461 24279 24386 D RefBase : #4 pc 0000000000346b24 /data/app/~~_jYhZrTezw6yMwi0NrcmfA==/com.cluckymedia.app-g06gV9QUYz7uYQn9aKPAOw==/lib/arm64/libpython3.11.so (PyRun_SimpleStringFlags+236)

    This was not occurring when using commit: 5aa9732

    Cheers

  3. T-Dynamos commented on Oct 27, 2025

    @T-Dynamos
    Member

    @CluckyMedia I see we don't have any recipe for pycryptodome yet, are you using some recipe for it? Or any pure python version?

    Sorry my bad, we do have a recipe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions