If you have any questions on programming, this is the place to ask them, whether you're a newbie or an experienced programmer. Discussion on programming in general is also welcome. We will help you with programming homework, but we will not do your work for you! Any porting requests must be made in Developmental Ideas.
The "Thread 1" part is just saying that the memory was being freed in Thread 1. That string of errors basically means that you've got something writing somewhere where it definitely shouldn't be. Its also possible that the error is caused by something like freeing memory that was never allocated in the first place.
Basically, how those errors are detected are as follows. When you pass a chunk of memory into free, it checks a tag that should have been added by malloc before the block of memory. This tag is 256 bytes in length, and includes various data about it. The 'magic' referred to in the error is the first entry in that 256 byte area. So, somehow something overwrote the first 4 bytes of an area that should never be touched in memory (since you shouldn't have any pointers to it).
If you want a more detailed look at it, look in the malloc.c file in kos/kernel/libc/koslib, and look for the public_fREe() function and follow it around a bit in the code. The function you're looking for should start on line 1735 of that file (at least in the current SVN it does).
I see... Thanks!
I saw this file, just thought that the memory can be damaged.
This means that nothing bad happened, just the memory apparently freed 2 times instead of 1?
Double-freeing is one possible way to cause that issue. You could also be freeing an invalid pointer, or it could be that you've written beyond the end (or beginning) of a buffer.
No matter what the issue is, you definitely have a problem in your code if you're getting those messages.