From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28625 invoked by alias); 12 Jan 2015 22:08:43 -0000 Mailing-List: contact libffi-discuss-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libffi-discuss-owner@sourceware.org Received: (qmail 28612 invoked by uid 89); 12 Jan 2015 22:08:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wi0-f181.google.com Received: from mail-wi0-f181.google.com (HELO mail-wi0-f181.google.com) (209.85.212.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 12 Jan 2015 22:08:40 +0000 Received: by mail-wi0-f181.google.com with SMTP id hi2so113788wib.2 for ; Mon, 12 Jan 2015 14:08:37 -0800 (PST) X-Received: by 10.194.93.5 with SMTP id cq5mr8003062wjb.84.1421100517163; Mon, 12 Jan 2015 14:08:37 -0800 (PST) Received: from [10.0.0.154] ([109.66.31.148]) by mx.google.com with ESMTPSA id ww4sm23220879wjc.47.2015.01.12.14.08.36 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Jan 2015 14:08:36 -0800 (PST) Message-ID: <54B4460B.60401@gmail.com> Date: Mon, 12 Jan 2015 22:08:00 -0000 From: Matti Picus User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: libffi-discuss@sourceware.org Subject: Possible issue with arm64 and multiple function arguments Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015/txt/msg00009.txt.bz2 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