This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Prevent inline function parameters from crashing the DWARF reader
- From: Tom Tromey <tom at tromey dot com>
- To: Keith Seitz <keiths at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 16 Oct 2018 16:15:06 -0600
- Subject: Re: [PATCH] Prevent inline function parameters from crashing the DWARF reader
- References: <20181012212141.29423-1-keiths@redhat.com>
>>>>> "Keith" == Keith Seitz <keiths@redhat.com> writes:
Keith> However, as demonstrated in this Fedora bugzilla:
Keith> https://bugzilla.redhat.com/show_bug.cgi?id=1638798
Keith> the abstract_origin of the parameter DIE may be in an entirely different
Keith> CU. This CU will have no builder defined for it, so the call to
Keith> get_current_context_stack is made on an uninitialized builder, and GDB
Keith> segfaults.
I was curious what happened before, so I checked out the commit
before 804d27291b2922f01fe5cc2d9ae759533d4a2f6f, and ran it on the
executable in that bug.
I set a breakpoint conditional on curr==0 and it never hit.
Now, I am not totally sure that this was correct before, but I suppose
what was going on was that the earlier code was installing these symbols
into the referencing CU's symtab.
Abstractly, at least, that seems reasonable. So maybe that approach
should be taken again.
Also, when I look at new_symbol, I see a bunch of uses of cu->builder,
so I wonder if there are ways to make those spots crash as well.
So maybe this indicates some different approach is needed as well.
Sorry about this. I didn't anticipate this at all. I can try to take
it over if you'd like.
Maybe one idea would be to temporarily set the referenced CU's builder
to the referencing CU's builder somehow.
Tom