From: Mark Wielaard <mark@klomp.org>
To: Tom de Vries <tdevries@suse.de>
Cc: dwz@sourceware.org, jakub@redhat.com
Subject: Re: [committed] Don't call die_odr_state with unnecessarily defined cu arg
Date: Mon, 22 Feb 2021 23:27:49 +0100 [thread overview]
Message-ID: <20210222222749.GF2992@wildebeest.org> (raw)
In-Reply-To: <20210222153902.GA412@delia.home>
Hi Tom,
On Mon, Feb 22, 2021 at 04:39:03PM +0100, Tom de Vries wrote:
> Hi,
>
> When compiling dwz with this patch:
> ...
> die_odr_state (dw_cu_ref cu, dw_die_ref die)
> {
> if (die->die_odr_state != ODR_UNKNOWN)
> - return die->die_odr_state;
> + {
> + assert (cu == NULL);
> + return die->die_odr_state;
> + }
> ...
> and running f.i. odr-struct.sh, we run into the abort.
>
> The recent commit 3312feb "Fix CK_BAD propagation for --odr" introduced this
> code:
> ...
> if (die_odr_state (die_cu (die), die) != ODR_NONE)
> die->u.p1.die_ref_hash = die->u.p1.die_hash;
> ...
> and there's no need to pass a CU argument, which makes the abort trigger.
>
> Fix this by passing a NULL CU instead.
>
> Committed to trunk.
>
> Thanks,
> - Tom
>
> Don't call die_odr_state with unnecessarily defined cu arg
>
> 2021-02-22 Tom de Vries <tdevries@suse.de>
>
> * dwz.c (read_debug_info): Pass NULL CU to die_odr_state call.
>
> ---
> dwz.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/dwz.c b/dwz.c
> index 076f39c..86863ce 100644
> --- a/dwz.c
> +++ b/dwz.c
> @@ -7253,7 +7253,7 @@ read_debug_info (DSO *dso, int kind, unsigned int *die_count)
> {
> if (die->die_ck_state != CK_KNOWN)
> continue;
> - if (die_odr_state (die_cu (die), die) != ODR_NONE)
> + if (die_odr_state (NULL, die) != ODR_NONE)
> die->u.p1.die_ref_hash = die->u.p1.die_hash;
> else
> die->die_ref_hash_computed = 0;
I might be a little lost in the odr code. It seems there is only one
call to die_odr_state that passes a non-NULL cu (the call in
checksum_die).
What does passing a NULL cu signify in this code? If cu is NULL it
seems the code that calls set_die_odr_state at the end of
die_ord_state is unsafe (because it might check cu).
Just wondering if when passing NULL in as cu the result isn't simply
always die->die_odr_state? (And if so, do we even need the function
call?)
Cheers,
Mark
next prev parent reply other threads:[~2021-02-22 22:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-22 15:39 Tom de Vries
2021-02-22 22:27 ` Mark Wielaard [this message]
2021-02-23 10:00 ` [PATCH] Clean up die_odr_state interface Tom de Vries
2021-02-23 10:14 ` Mark Wielaard
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=20210222222749.GF2992@wildebeest.org \
--to=mark@klomp.org \
--cc=dwz@sourceware.org \
--cc=jakub@redhat.com \
--cc=tdevries@suse.de \
/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).