Crasher in dwarf2-frame.c - memory reuse

Andrew Cagney ac131313@redhat.com
Tue Jun 17 02:57:00 GMT 2003


> On Mon, Jun 16, 2003 at 05:00:20PM -0400, Andrew Cagney wrote:
> 
>> >So, reread_symbols frees the objfile, but does not clear sym_private. 
>> >Clearing it in reread_symbols fixes the crash, but presumably leaks 
>> >memory. How are we supposed to clean up the FDE list?
> 
>> 
>>       fde = (struct dwarf2_fde *)
>>         obstack_alloc (&unit->objfile->psymbol_obstack,
>>                        sizeof (struct dwarf2_fde));
>> 
>> so won't the symbol table free, free that memory?
> 
> 
> Silly me.  I thought it was malloc'd.  In that case the fix is obvious;
> I'll get it in a little bit.

[it was one of the things I noted when giving marks patch the once over 
- it got rid of michaelL's memory leak]

BTW, there are lots of other places that should also use obstacks - the 
architecture vector for instance.

Andrew




More information about the Gdb mailing list