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: 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: Thu, 06 Apr 2023 12:46:45 +0100	[thread overview]
Message-ID: <87355dkzbu.fsf@esperi.org.uk> (raw)
In-Reply-To: <ZCF8ekefjBi5Ky5R@squeak.grove.modra.org> (Alan Modra's message of "Mon, 27 Mar 2023 21:52:34 +1030")

On 27 Mar 2023, Alan Modra stated:
> On Mon, Mar 27, 2023 at 11:27:40AM +0100, Nick Alcock wrote:
>> Are they all 32-bit platforms? It looks like it.
>
> Yes, and built on x86_64-linux.  Which is why things go wrong.
> "lookup" is compiled and running on x86_64, thus compiled in offsets
> are for the 64-bit host.  The test objects are compiled by the
> relevant target compiler, in this case all 32-bit.  Things would break
> with a 32-bit host and 64-bit targets too of course.

I have a fix under test that just turns this test off when
cross-compiling. It just doesn't make sense to assume that datatypes
have similar sizes on distinct platforms, regardless of the state of
some woolly generality like "bitness". I suppose I could use the same
tricks Autoconf does to get sizeof()s without execution, but for this
test that feels like total overkill. This isn't a cross-compilation bug,
it bites everywhere, so native-only tests will suffice to stop it
returning.

>> 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.
>
> It's funny how we tend to not suspect the test.  :)

At least that's usually fixable with better ways to run the testsuite
that spot bugs in the tests :) This round of fixes is taking longer than
I'd hoped because valgrind and ASAN spotted uninitialized data usage and
memory leaks in a new test...

(I really should put the pile of scripts that controls my tests online
somewhere: even if some of them rely on things like homebrew
containerization hacks and so won't run without modification, the
combination might still be valuable. These days they're mostly run under
pueue, a rather nice queueing system for noninteractive programs.)

-- 
NULL && (void)

  parent reply	other threads:[~2023-04-06 11:46 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
2023-03-27 11:22       ` Alan Modra
2023-03-27 12:38         ` Nick Alcock
2023-04-06 11:46         ` Nick Alcock [this message]
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=87355dkzbu.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).