public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Nick Alcock <nick.alcock@oracle.com>
To: Alan Modra <amodra@gmail.com>
Cc: Nick Alcock <nick.alcock@oracle.com>,
	binutils@sourceware.org,
	Indu Bhagat <gitlab@linux-git.oraclecorp.com>
Subject: Re: [PATCH 4/4] libctf: get the offsets of fields of unnamed structs/unions right
Date: Mon, 27 Mar 2023 11:27:40 +0100	[thread overview]
Message-ID: <87y1nilc9v.fsf@esperi.org.uk> (raw)
In-Reply-To: <ZB6Ptl1/1lJ6tX2E@squeak.grove.modra.org> (Alan Modra's message of "Sat, 25 Mar 2023 16:37:50 +1030")

On 25 Mar 2023, Alan Modra verbalised:

> On Fri, Mar 24, 2023 at 01:36:25PM +0000, Nick Alcock via Binutils wrote:
>> 	* testsuite/libctf-lookup/unnamed-field-info*: New test.
>
> arm-linux-gnueabi  +FAIL: /home/alan/src/binutils-gdb/libctf/testsuite/libctf-lookup/unnamed-field-info.c
> hppa-linux-gnu  +FAIL: /home/alan/src/binutils-gdb/libctf/testsuite/libctf-lookup/unnamed-field-info.c
> m68k-linux-gnu  +FAIL: /home/alan/src/binutils-gdb/libctf/testsuite/libctf-lookup/unnamed-field-info.c
> microblaze-linux-gnu  +FAIL: /home/alan/src/binutils-gdb/libctf/testsuite/libctf-lookup/unnamed-field-info.c
> mips-linux-gnu  +FAIL: /home/alan/src/binutils-gdb/libctf/testsuite/libctf-lookup/unnamed-field-info.c
> powerpc-linux-gnu  +FAIL: /home/alan/src/binutils-gdb/libctf/testsuite/libctf-lookup/unnamed-field-info.c
> s390-linux-gnu  +FAIL: /home/alan/src/binutils-gdb/libctf/testsuite/libctf-lookup/unnamed-field-info.c
> sh4-linux-gnu  +FAIL: /home/alan/src/binutils-gdb/libctf/testsuite/libctf-lookup/unnamed-field-info.c

Weird. I tested on two of those! (arm and powerpc).

Are they all 32-bit platforms? It looks like it.

> The fails look like:
> field b inconsistency: offsetof() says 64 bits, CTF says 32
> field one inconsistency: offsetof() says 128 bits, CTF says 64
> field two inconsistency: offsetof() says 192 bits, CTF says 96
> field three inconsistency: offsetof() says 256 bits, CTF says 128
> field four inconsistency: offsetof() says 320 bits, CTF says 160
> field x inconsistency: offsetof() says 384 bits, CTF says 192
> field y inconsistency: offsetof() says 448 bits, CTF says 256
> field z inconsistency: offsetof() says 384 bits, CTF says 192
> field aleph inconsistency: offsetof() says 448 bits, CTF says 224

All failing platforms are 32-bit, and they're all out by a factor of
two. Just a coincidence, perhaps. (Definitely no more than a vague
hunch.)

I'll take a look. Maybe I can just make the test less picky -- all we're
actually interested in for this bug is "CTF says 0". But this is worthy
of investigation regardless. It's just as likely to be a compiler bug
as a bug in libctf, I'd guess.

-- 
NULL && (void)

  reply	other threads:[~2023-03-27 10:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-24 13:36 [PATCH 1/4] libctf: fix assertion failure with no system qsort_r Nick Alcock
2023-03-24 13:36 ` [PATCH 2/4] libctf: work around an uninitialized variable warning Nick Alcock
2023-03-24 13:36 ` [PATCH 3/4] libctf: fix a comment typo Nick Alcock
2023-03-24 13:36 ` [PATCH 4/4] libctf: get the offsets of fields of unnamed structs/unions right Nick Alcock
2023-03-25  6:07   ` Alan Modra
2023-03-27 10:27     ` Nick Alcock [this message]
2023-03-27 11:22       ` Alan Modra
2023-03-27 12:38         ` Nick Alcock
2023-04-06 11:46         ` Nick Alcock
2023-04-08 15:50           ` Nick Alcock

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=87y1nilc9v.fsf@esperi.org.uk \
    --to=nick.alcock@oracle.com \
    --cc=amodra@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=gitlab@linux-git.oraclecorp.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).