Rockbox mail archiveSubject: Re: Memset corrupts memory?
Re: Memset corrupts memory?
From: Linus Nielsen Feltzing <linus_at_haxx.se>
Date: Wed, 17 Jul 2002 17:59:08 +0200
On Tue, 16 Jul 2002 22:49:12 -0700, Alex Gitelman wrote:
>After recent changes the following code crashes my recorder on file
>Reducing count in memset, say to 64 or removing memset altogether
>allows it to run.
>Crash consists of recorder showing some meaningless word (Stkov in
>case - always), HD ligh is on and it hangs.
Hehe. It's nice to see that my work on the stack check code paid off
sooner than i expected. The text you see is not at all meaningless.
It says: "Stkov", which means Stack Overflow. You have exceeded the
allocated stack space with the huge local char array.
As mentioned in the other replies, use malloc(), allocate it outside
the function or declare it "static".
Received on 2002-07-17