Re: [cc65] Why crashing attempting to free this struct?

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2012-03-25 20:52:56
On Sat, Mar 24, 2012 at 07:46:48PM -0500, Payton Byrd wrote:
>    I get a CPU jam whenever I attempt to free an instance of
>    DirectoryListReuBlock.  I've got no idea what's causing this, but they
>    have to be freed or I'll have memory leaks galore.

You should make sure that you don't have memory corruption elsewhere. If you
overwrite memory that isn't in use at that moment, nothing bad will happen.
Your program will continue to run and may crash minutes or even hour later.
But when the error occurs, the real problem is somewhere in the past.

My suggestion - apart from what other people have said - is to load the
application into VICE, but don't start it. Then check the map file and write
protect in VICE the address spaces of all segments that should not be written
to:

  * LOADADDR
  * EXEHDR
  * STARTUP
  * INIT
  * CODE
  * RODATA

And maybe also the kernal ROM space.

Then run your program again. With some luck, VICE will stop the program when
it overwrites code memory and you have the exact location of the code causing
the problem.

I've found some really nasty memory corruption bugs in Elite this way.

Regards


        Uz


-- 
Ullrich von Bassewitz                                  uz@musoftware.de
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Sun Mar 25 20:53:05 2012

This archive was generated by hypermail 2.1.8 : 2012-03-25 20:53:08 CEST