Re: [cc65] calloc() not failing

From: Marc 'BlackJack' Rintsch <>
Date: 2012-11-12 23:49:42
2012-11-12 19:46, Ullrich von Bassewitz <>:

> On Mon, Nov 12, 2012 at 07:39:15PM +0100, Ullrich von Bassewitz wrote:
> > On Mon, Nov 12, 2012 at 10:19:02AM +0100, Marc 'BlackJack' Rintsch 
> > > First time I run this, the program returns to the BASIC
> > > interpreter without printing the "Error" I expect.  On the next
> > > run the system hangs after half of the video memory is filled
> > > with @ signs, so it looks like `calloc()` fills memory it
> > > clearly shouldn't.  This pattern of the two runs is reproducible
> > > regardless of the compiler options for optimizations.
> > 
> > Sorry, but the program runs without errors here. Tried with the
> > current snapshot and with 2.13.3 on Vice in C64 emulation. Is
> > there anything special about your setup?

If I set the second parameter to 204 then it crashes the *first* time I 
run it.  Same symptom — screen memory fills half way with zero bytes, 
then the system hangs.

$ cc65 --version
cc65 V2.13.9
SVN version: 5928

> Is it possible that you restart the program without loading it into
> memory a second time? This doesn't work, since initialized data
> doesn't have the correct content.

That worked for me all the years with all the programs I wrote.  If this 
was just a lucky coincidence then programs should not return to the 
BASIC prompt and leave a ”runnable” program behind IMHO.  It's quite a 
surprise for me.

	Marc 'BlackJack' Rintsch
“»I'm not going to ride on a magic carpet!« he hissed.
 »I'm afraid of grounds!«
 »You mean heights,« said Conina. »And stop being silly.«
 »I know what I mean! It's the grounds that kill you!«”
                             -- Terry Pratchett, Sourcery
To unsubscribe from the list send mail to with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Mon Nov 12 23:50:25 2012

This archive was generated by hypermail 2.1.8 : 2012-11-12 23:50:28 CET