This is the mail archive of the
libffi-discuss@sourceware.org
mailing list for the libffi project.
Re: s390x ffi_closure_helper_SYSV
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: planrichi at gmail dot com (Richard Plangger)
- Cc: libffi-discuss at sourceware dot org
- Date: Mon, 21 Dec 2015 19:39:30 +0100 (CET)
- Subject: Re: s390x ffi_closure_helper_SYSV
- Authentication-results: sourceware.org; auth=none
Hi Richard,
> thx for your reply. I agree that it makes sense to return a full ffi_arg
> if the integral value is smaller than the machine register.
It's not a matter of what makes sense, it's a matter of what libffi
*expects the user-provided callback to do*. If the *callback* doesn't
fill in a full ffi_arg, then libffi will not operate correctly.
> The program pollutes a fairly large junk of memory below the frame
> pointer and then calls back to a python function (from c).
> Because the ret_buffer variable (in ffi_closure_helper_SYSV) is not
> initialized properly, the returned value is not the same on s390x as it
> is on e.g. x86.
The point is that if the user-callback were to fill in a full ffi_arg,
then ret_buffer would be completely filled. If ret_buffer isn't fully
written, then that's a bug in the callback PyPy provides to libffi.
> `make` on my laptop (x86) returns without asserting, but
> it does not on s390x. PPC was recently implemented on PyPy and there we
> did also not hit this issue.
Is this on little-endian or big-endian PowerPC?
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU/Linux compilers and toolchain
Ulrich.Weigand@de.ibm.com