public inbox for libffi-discuss@sourceware.org
 help / color / mirror / Atom feed
From: "Péter Iványi" <parenghu@gmail.com>
To: libffi-discuss@sourceware.org
Subject: ffi 3.3.rc0 problem
Date: Mon, 01 Jul 2019 16:18:00 -0000	[thread overview]
Message-ID: <CANex-EeP+4Qjem7bFEDhc134F_qVn86DLSrqb8OWqEDGC-HKXA@mail.gmail.com> (raw)

Hi!

I have downloaded the latest version (3.3.rc0) of FFI from Github.
The code under the x86 architecture has changed sine 3.2.1 and it is not working
with Visual Studio for 32 bit Windows programs.

I have traced back the problem to
src/x86/ffi.c:294
where the system uses the "alloca" function.
I think the problem is that Visual Studio is applying stack canaries when it is
using alloca. It places CCCCCCCCh values under the allocated stack
space. When the function is exiting, it is checking for the existence
of these stack
canaries. However in the sysv_intel.S code there is a "messing around"
with the stack
and the stack canaries are overwritten.

May I ask why the x86 code has been changed?
What was the reason?

Version 3.2.1 was and is working!
I have a cmake building system for ffi. I can send it if you want to check it.

Best regards,

Peter Ivanyi

                 reply	other threads:[~2019-07-01 16:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=CANex-EeP+4Qjem7bFEDhc134F_qVn86DLSrqb8OWqEDGC-HKXA@mail.gmail.com \
    --to=parenghu@gmail.com \
    --cc=libffi-discuss@sourceware.org \
    /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).