public inbox for libffi-discuss@sourceware.org
 help / color / mirror / Atom feed
* ../src/x86/ffi64.c:552:5: runtime error: store to misaligned address
@ 2019-09-18 14:01 Jeffrey Walton
  2019-09-18 14:21 ` Matthias Klose
  0 siblings, 1 reply; 2+ messages in thread
From: Jeffrey Walton @ 2019-09-18 14:01 UTC (permalink / raw)
  To: libffi-discuss

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: ../src/x86/ffi64.c:552:5: runtime error: store to misaligned address
  2019-09-18 14:01 ../src/x86/ffi64.c:552:5: runtime error: store to misaligned address Jeffrey Walton
@ 2019-09-18 14:21 ` Matthias Klose
  0 siblings, 0 replies; 2+ messages in thread
From: Matthias Klose @ 2019-09-18 14:21 UTC (permalink / raw)
  To: noloader, libffi-discuss

On 18.09.19 16:01, Jeffrey Walton wrote:
> 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.

you could verify that by getting the source shipped in the distribution

   apt source libffi

and point "make check" to the source.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-09-18 14:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-18 14:01 ../src/x86/ffi64.c:552:5: runtime error: store to misaligned address Jeffrey Walton
2019-09-18 14:21 ` Matthias Klose

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).