From: Tom de Vries <tdevries@suse.de>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] [gdb/symtab] Add assert in free_cached_comp_units constructor
Date: Mon, 1 Jun 2026 10:02:28 +0200 [thread overview]
Message-ID: <7168b9e1-3102-4484-928e-53b5e55ffdf4@suse.de> (raw)
In-Reply-To: <83c3a4ea-9f74-4afe-8963-ce0ec9495a22@suse.de>
On 5/30/26 2:52 PM, Tom de Vries wrote:
> On 5/28/26 6:43 PM, Tom Tromey wrote:
>>>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:
>>
>> Tom> Detect this situation using an assert in the free_cached_comp_units
>> Tom> constructor.
>>
>> Seems fine to me.
>
> Thanks for the review.
>
> I committed this, but afterwards ran into trouble on x86_64-linux with
> test-cases gdb.ada/uninitialized-variable-record.exp and gdb.ada/
> uninitialized_vars.exp on x86_64-linux, so I've reverted this.
>
I've investigated this, and found that this is due to calls to load_cu
in places other than dw2_do_instantiate_symtab.
For test-case gdb.ada/uninitialized_vars.exp, it's
dwarf2_fetch_die_loc_cu_off.
I do wonder if ~free_cached_comp_units is a bit overeager, and should
refrain from deleting cached comp units that were present at
construction time.
Anyway, the assert detected the use-after-free I created, but just
doesn't hold in general.
Thanks,
- Tom
> Thanks,
> - Tom
>
>>
>> Approved-By: Tom Tromey <tom@tromey.com>
>>
>> Tom
>
next prev parent reply other threads:[~2026-06-01 8:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-27 9:57 Tom de Vries
2026-05-28 16:43 ` Tom Tromey
2026-05-30 12:52 ` Tom de Vries
2026-06-01 8:02 ` Tom de Vries [this message]
2026-06-01 15:18 ` Simon Marchi
2026-06-08 14:20 ` Tom de Vries
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=7168b9e1-3102-4484-928e-53b5e55ffdf4@suse.de \
--to=tdevries@suse.de \
--cc=gdb-patches@sourceware.org \
--cc=tom@tromey.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