[New-bugs-announce] [issue47208] Support libffi implementations that cannot support invocations with 1024 arguments
Hood Chatham
report at bugs.python.org
Sun Apr 3 20:27:44 EDT 2022
New submission from Hood Chatham <roberthoodchatham at gmail.com>:
ctypes defines `CTYPES_MAX_ARGCOUNT` to be 1024:
https://github.com/python/cpython/blob/6db2db91b96aaa1270c200ec931a2250fe2799c7/Modules/_ctypes/ctypes.h#L21
If a function call is attempted with more than 1024 arguments, it will fail. The libffi emscripten port github.com/hoodmane/libffi-emscripten can only support function calls with at most 122 arguments due to limitations in Emscripten / Wasm:
https://github.com/emscripten-core/emscripten/pull/16653
I propose to allow the libffi port to define FFI_MAX_CLOSURE_ARGS and if this is defined then use this number instead for `CTYPES_MAX_ARGCOUNT`.
https://github.com/libffi/libffi/issues/703
The test `test_callback_too_many_args` should also be updated to respect the value of `CTYPES_MAX_ARGCOUNT` rather than hardcoding 1024 into the test.
----------
components: ctypes
messages: 416646
nosy: hoodchatham
priority: normal
severity: normal
status: open
title: Support libffi implementations that cannot support invocations with 1024 arguments
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue47208>
_______________________________________
More information about the New-bugs-announce
mailing list