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.

Author David.Edelsohn
Recipients Ayappan, BTaskaya, David.Edelsohn, Michael.Felt, T.Rex, amaury.forgeotdarc, belopolsky, meador.inge, ronaldoussoren, sanket
Date 2020-08-04.18:28:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1596565693.65.0.506199672253.issue38628@roundup.psfhosted.org>
In-reply-to
Content
As mentioned in the stgdict.c comment, this relates back to #22273 and #29565. The passing of arrays/structs is fragile, to use a euphemism. The ctypes behavior conforms to the x64 Linux ABI and x64 libffi, even the comment from #22273,

"Structs that are larger than 32 bytes get copied to the stack (see classify_argument in ffi64.c), so we don't have to worry about classifying their elements for register passing. Thus if a new field is added for this in StgDictObject, then PyCArrayType_new should only allocate it for array types that are 32 bytes or less. Using it for larger array types would serve no point.

And now we're at the crux of the problem.  I don't know what Ronald and others recommend.  ctypes is choosing x64 behavior to define an inherently target-dependent and ABI-dependent design decisions.  The real solution requires that _ctypes/stgdict.c incorporate target-specific logic, but it's not clear that the Python community wants to go down that path.
History
Date User Action Args
2020-08-04 18:28:13David.Edelsohnsetrecipients: + David.Edelsohn, ronaldoussoren, amaury.forgeotdarc, belopolsky, meador.inge, Michael.Felt, Ayappan, BTaskaya, sanket, T.Rex
2020-08-04 18:28:13David.Edelsohnsetmessageid: <1596565693.65.0.506199672253.issue38628@roundup.psfhosted.org>
2020-08-04 18:28:13David.Edelsohnlinkissue38628 messages
2020-08-04 18:28:13David.Edelsohncreate