From mint-bounce@lists.fishpool.fi Mon Jan 25 17:20:33 2010 X-SourceIP: 77.249.76.7 Message-ID: <4B5E1890.8080002@chello.nl> Date: Mon, 25 Jan 2010 23:17:52 +0100 From: Henk Robbers User-Agent: Mozilla Thunderbird 1.0.2 (Macintosh/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: mint@lists.fishpool.fi Subject: Re: [MiNT] windom and gcc4 References: <420195.6969.qm@web27401.mail.ukl.yahoo.com> <201001241235.58825.jflemaire@skynet.be> <4B5CB531.1010806@free.fr> <4B5CC2EB.5060603@lutece.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-ecartis-version: Ecartis v1.0.0 Sender: mint-bounce@lists.fishpool.fi Errors-to: mint-bounce@lists.fishpool.fi X-original-sender: h.robbers@chello.nl Precedence: bulk List-help: List-unsubscribe: List-Id: X-List-ID: List-subscribe: List-owner: List-post: Miro Kropacek wrote: >>I have seen too that Zview crash before quit, this is true now I try to >>remember I never find why, it is possible that it is when unload ldg, >>personnaly as I not unload ldg with this function for my application I never >>see it. I can try to find this bug in some days. >> > > I know where the bug is I just don't know why it happens, it seems like > incorrect allocation in the first place, ldg_unload: > > if( ldg) { > if( ldg->close) (*ldg->close)(); > Mfree( ((BASPAG *)ldg->baspag)->p_env); > Mfree( ldg->baspag); > ldg->baspag = NULL; > } > > crash occurs on the last line, ldg->baspage = NULL (!), if I comment this > out, everything is OK. It seems that Mfree() frees more than it should (i.e. > freeing also the memory where 'ldg' points to) > What if ldg points to something in the freed area? Maybe ldg itself is the pointer the the Malloc'd area. Maybe baspag is the first member of the struct. In which case ldg and ldg->baspag point to the same address :-) Just a possibility. Find the Malloc. -- Groeten; Regards. Henk Robbers. http://members.chello.nl/h.robbers Interactive disassembler: TT-Digger; http://digger.atari.org A Home Cooked C compiler: AHCC; http://ahcc.atari.org