public inbox for libffi-discuss@sourceware.org
 help / color / mirror / Atom feed
From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: planrichi@gmail.com (Richard Plangger)
Cc: libffi-discuss@sourceware.org
Subject: Re: s390x ffi_closure_helper_SYSV
Date: Mon, 21 Dec 2015 18:47:00 -0000	[thread overview]
Message-ID: <20151221183930.372366414@oc7340732750.ibm.com> (raw)
In-Reply-To: <56730DB0.2080301@gmail.com> from "Richard Plangger" at Dec 17, 2015 08:32:00 PM

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

  reply	other threads:[~2015-12-21 18:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-17 15:05 Richard Plangger
2015-12-17 15:30 ` Ulrich Weigand
2015-12-17 19:32   ` Richard Plangger
2015-12-21 18:47     ` Ulrich Weigand [this message]
2015-12-22 17:03       ` Richard Plangger
2016-01-04 16:54       ` Richard Plangger
2015-12-18 15:09   ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151221183930.372366414@oc7340732750.ibm.com \
    --to=uweigand@de.ibm.com \
    --cc=libffi-discuss@sourceware.org \
    --cc=planrichi@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).