dev builds
themes manual
device status forums
mailing lists
IRC bugs
dev guide

Rockbox mail archive

Subject: Re: Memset corrupts memory?

Re: Memset corrupts memory?

From: Alex Gitelman <>
Date: Tue, 16 Jul 2002 23:06:31 -0700

Apparently problem is not memset but in allocation of local array.
If you replace out_buf[10000] with out_buf = malloc(10000) -> problem
seems to be gone.

Tuesday, July 16, 2002, 10:49:12 PM, you wrote:

AG> After recent changes the following code crashes my recorder on file
AG> read operation.
AG> Reducing count in memset, say to 64 or removing memset altogether
AG> allows it to run.
AG> Crash consists of recorder showing some meaningless word (Stkov in my
AG> case - always), HD ligh is on and it hangs.
AG> /test.txt is a small (non empty file) I also tried with bigger files.
AG> Best Regards
AG> Alex

AG> void app_main(void)
AG> {
AG> init();

AG> {
AG> unsigned char out_buf[10000];
AG> int fd = open("/test.txt", O_RDONLY);
AG> if (fd<0)
AG> panicf("Can't open");
AG> memset(out_buf, 0x00, 5000);
AG> read(fd, out_buf, 64);
AG> close(fd);
AG> }

AG> browse_root();
AG> }
Received on 2002-07-17

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy