This is the mail archive of the libffi-discuss@sourceware.org mailing list for the libffi project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Possible issue with arm64 and multiple function arguments


I submitted a bug fix for python ctypes on win64 where pass-by-value was failing for structs bigger than 8 bytes. I based the fix on the cffi library for python, which uses a custom MSVC backend and not the latest libffi. Sorry about that, maybe someday I will take a look as MSVC compilation of libffi. But that is not the point of this mail :).

The fix involved writing a test of a function with 8 parameters, some by-pointer structs and some by-ref structs. This test was written to pass on all platforms, but this bug report

https://bugzilla.redhat.com/show_bug.cgi?id=1174037

indicates it fails on arm64 (aarch64) linux. The gist of the test is c code and a call from python, and I have copy-pasted the relevant parts to here

https://gist.github.com/mattip/9e41a3a7f4361a372c67

I could not find anything similar in your test suite, but I am new to your code.
So now the questions:

- is there a test like this in the suite that I overlooked?
- if not, where would be an appropriate place to add such a test?
- could there indeed be a bug in arm64 where the arguments spill out of registers into the stack, and why would it not show up on arm32 (which passes the test)?

Thanks for your great library.
Matti



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]