Rockbox mail archive
Subject: Re: Memset corrupts memory?
From: Linus Nielsen Feltzing (linus_at_haxx.se)
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".
Page was last modified "Jan 10 2012" The Rockbox Crew