Bug 388895 - LibVEX_FrontEnd assertion failure: `0 == sizeof(VexGuestX86State) % LibVEX_GUEST_STATE_ALIGN'
Summary: LibVEX_FrontEnd assertion failure: `0 == sizeof(VexGuestX86State) % LibVEX_GU...
Status: RESOLVED INTENTIONAL
Alias: None
Product: valgrind
Classification: Developer tools
Component: vex (other bugs)
Version First Reported In: 3.14 SVN
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-13 05:06 UTC by bob
Modified: 2018-08-06 08:24 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Tiny test case (208 bytes, text/x-csrc)
2018-01-13 05:07 UTC, bob
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bob 2018-01-13 05:06:03 UTC
Upon calling LibVEX_FrontEnd (with the args configured for an AMD64 host and an x86 guest), libvex bails out with the following message:

    priv/main_main.c:375 (LibVEX_FrontEnd): Assertion `0 == sizeof(VexGuestX86State) % LibVEX_GUEST_STATE_ALIGN' failed.
Comment 1 bob 2018-01-13 05:07:12 UTC
Created attachment 109830 [details]
Tiny test case

➜  test  gcc test.c
➜  test  ./a.out
ALIGN: 16
SIZE: 360
Comment 2 bob 2018-01-13 05:18:52 UTC
Just tested against the header from git master, and the result is the same. I assume it's a mirror of the 3.14 SVN?

Sorry for the noise.
Comment 3 Ivo Raisr 2018-01-13 19:46:41 UTC
SVN is a past thing. Valgrind lives in GIT now:
http://valgrind.org/downloads/repository.html
Comment 4 bob 2018-01-15 10:37:55 UTC
I've been fiddling with the headers a little, and it turns out that GCC on my system seems to always pad VexGuestX86State and then align by 8. The header in git has a 16-aligned size if I specify the packed GCC attribute.

It seems to be that an extra four bytes of padding are added after the segment registers to 8-align the guest_LDT member. Moving one of the trailing padding ints to after guest_SS gives a 16-aligned size.
Comment 5 Julian Seward 2018-08-06 08:24:12 UTC
(In reply to bob from comment #0)
> Upon calling LibVEX_FrontEnd (with the args configured for an AMD64 host and
> an x86 guest), libvex bails out with the following message:

We gave up on supporting cross-target Vex some years back, so I am not
surprised this doesn't work.  It seems unlikely to me that it'll get fixed
any time soon.