From: Richard Biener <richard.guenther@gmail.com>
To: Indu Bhagat <indu.bhagat@oracle.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] debug/102507: ICE in btf_finalize when compiling with -gbtf
Date: Wed, 29 Sep 2021 09:13:38 +0200 [thread overview]
Message-ID: <CAFiYyc0opY=Zv2nndK11EdDKc2-jYUdr023keFTyX+cpTMkV7g@mail.gmail.com> (raw)
In-Reply-To: <1632854443-6232-1-git-send-email-indu.bhagat@oracle.com>
On Tue, Sep 28, 2021 at 8:41 PM Indu Bhagat via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> Fix the free'up of btf_var_ids hash_map in btf_finalize ().
OK.
> Testing notes:
>
> - Bootstrapped GCC with -gbtf as an experiment.
> - Usual bootstrap and regression testing on x86_64.
> - BPF backend testing - make all-gcc, reg tested bpf.exp, btf.exp and ctf.exp.
> (tested using David Faust's config.gcc patch posted earlier
> https://gcc.gnu.org/pipermail/gcc-patches/2021-September/580422.html)
>
> gcc/ChangeLog:
>
> PR debug/102507
> * btfout.c (GTY): Add GTY (()) albeit for cosmetic only purpose.
> (btf_finalize): Empty the hash_map btf_var_ids.
> ---
> gcc/btfout.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/gcc/btfout.c b/gcc/btfout.c
> index cdc6c63..a787815 100644
> --- a/gcc/btfout.c
> +++ b/gcc/btfout.c
> @@ -70,7 +70,7 @@ static char btf_info_section_label[MAX_BTF_LABEL_BYTES];
> converted to BTF_KIND_VAR type records. Strictly accounts for the index
> from the start of the variable type entries, does not include the number
> of types emitted prior to the variable records. */
> -static hash_map <ctf_dvdef_ref, unsigned int> *btf_var_ids;
> +static GTY (()) hash_map <ctf_dvdef_ref, unsigned> *btf_var_ids;
>
> /* Mapping of type IDs from original CTF ID to BTF ID. Types do not map
> 1-to-1 from CTF to BTF. To avoid polluting the CTF container when updating
> @@ -1119,12 +1119,12 @@ btf_finalize (void)
>
> funcs = NULL;
>
> + btf_var_ids->empty ();
> + btf_var_ids = NULL;
> +
> free (btf_id_map);
> btf_id_map = NULL;
>
> - ggc_free (btf_var_ids);
> - btf_var_ids = NULL;
> -
> ctf_container_ref tu_ctfc = ctf_get_tu_ctfc ();
> ctfc_delete_container (tu_ctfc);
> tu_ctfc = NULL;
> --
> 1.8.3.1
>
prev parent reply other threads:[~2021-09-29 7:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-28 18:40 Indu Bhagat
2021-09-29 7:13 ` Richard Biener [this message]
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='CAFiYyc0opY=Zv2nndK11EdDKc2-jYUdr023keFTyX+cpTMkV7g@mail.gmail.com' \
--to=richard.guenther@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=indu.bhagat@oracle.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).