public inbox for libffi-discuss@sourceware.org
 help / color / mirror / Atom feed
* Arrays inside structs, passed by value
@ 2014-08-28 16:39 Weeble
  0 siblings, 0 replies; only message in thread
From: Weeble @ 2014-08-28 16:39 UTC (permalink / raw)
  To: libffi-discuss

Hi,

I'm trying to investigate a problem I've found in a Python library
that uses ctypes to call into native code, and causes an abort in
libffi. The problem occurs when calling a function that looks like
this:

    struct array_struct {
        uint8_t data[16];
    }
    void problem_func(struct array_struct arg);

The problem occurs on 64-bit Linux, when the array contains integers
and has a size between 9 and 16 bytes. More details can be found here:

* http://stackoverflow.com/questions/25487928/is-this-the-correct-way-to-pass-a-struct-by-value-in-ctypes
* http://bugs.python.org/issue22273

I'm trying to determine if the problem lies in Python or libffi. My
difficulty here is that I can't find anything in the docs that says
that libffi supports calling such a function, even though I found some
hints in old conversations that there might be a way. Is it possible
to create an ffi_type that describes a struct containing an array? If
so, what is the correct approach?

Best regards,

Weeble.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-08-28 16:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-28 16:39 Arrays inside structs, passed by value Weeble

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).