public inbox for libffi-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Jeffrey Walton <noloader@gmail.com>
To: libffi-discuss@sourceware.org
Subject: ../src/x86/ffi64.c:552:5: runtime error: store to misaligned address
Date: Wed, 18 Sep 2019 14:01:00 -0000	[thread overview]
Message-ID: <CAH8yC8=Vxj6CF4P6b9+-mHbgOwSZnFkVM84QdYqaYwc5a_eDog@mail.gmail.com> (raw)

Hi Everyone,

I'm testing OpenSC 0.19.0 using a sanitizer build. The sanitizer is
UBsan, and it is enabled with -fsanitize=undefined in CFLAGS and
CXXFLAGS.

OpenSC depends upon p11-kit, and p11-kit depends upon libffi. During
testing of p11-kit, libffi is producing a finding when I 'make check':

../src/x86/ffi64.c:552:5: runtime error: store to misaligned address
0x7ff660b53012 for type 'long long unsigned int', which requires 8
byte alignment
0x7ff660b53012: note: pointer points here
 00 00  49 bb 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00
00 00 00 00  00 00 00 00 00 00
              ^
ERROR: test-managed - missing test plan

I believe the finding is produced by libffi-3.2.1. I can only say "I
believe" because I am having trouble tracking down
"../src/x86/ffi64.c". 'make check' is running from the p11-kit
directory, and ../src/x86/ffi64.c does not exist.

$ find /home/jwalton/tmp-sanitize -name '*ffi*'
/home/jwalton/tmp-sanitize/lib/libffi.so
/home/jwalton/tmp-sanitize/lib/pkgconfig/libffi.pc
/home/jwalton/tmp-sanitize/lib/libffi-3.2.1
/home/jwalton/tmp-sanitize/lib/libffi-3.2.1/include/ffitarget.h
/home/jwalton/tmp-sanitize/lib/libffi-3.2.1/include/ffi.h
/home/jwalton/tmp-sanitize/lib/libffi.so.6.0.4
/home/jwalton/tmp-sanitize/lib/libffi.la
/home/jwalton/tmp-sanitize/lib/libffi.so.6
/home/jwalton/tmp-sanitize/lib/libffi.a

These may be helpful:

$ lsb_release -a
No LSB modules are available.
Distributor ID:    Ubuntu
Description:    Ubuntu 18.04.3 LTS
Release:    18.04
Codename:    bionic

$ gcc --version
gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0

If you have trouble reproducing using just libffi test suite, then I
can offer directions for this setup. It is not too painful because I
have scripts to drive the process. The scripts are on GitHub.

Jeff

             reply	other threads:[~2019-09-18 14:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-18 14:01 Jeffrey Walton [this message]
2019-09-18 14:21 ` Matthias Klose

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='CAH8yC8=Vxj6CF4P6b9+-mHbgOwSZnFkVM84QdYqaYwc5a_eDog@mail.gmail.com' \
    --to=noloader@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).