From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7775 invoked by alias); 17 Jun 2003 02:57:53 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 913 invoked from network); 17 Jun 2003 02:54:41 -0000 Received: from unknown (HELO localhost.redhat.com) (24.157.166.107) by sources.redhat.com with SMTP; 17 Jun 2003 02:54:41 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 1E66C2B5F; Mon, 16 Jun 2003 22:54:19 -0400 (EDT) Message-ID: <3EEE82DA.50003@redhat.com> Date: Tue, 17 Jun 2003 02:57:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030223 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Daniel Jacobowitz Cc: gdb@sources.redhat.com Subject: Re: Crasher in dwarf2-frame.c - memory reuse References: <20030616134944.GA17095@nevyn.them.org> <3EEE2FE4.6050403@redhat.com> <20030616215412.GA12729@nevyn.them.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-06/txt/msg00331.txt.bz2 > 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