thank you both.
the code is written by my friend, he tested it on his machine with valgrind to avoid memory leaks. it returned no error. on my machine valgrind returns a whole bunch of "mismatched free/delete" thing, and sometimes during run time, instead of seg fault, it says something like"*****glibc detects double free******"
my friend says it might be glibc that's giving me problem. i think the version i have is the most current one. how do i fix this?
oh, i've also swapped different memory modules, same result, so i don't think it's hardware issue.
thank you again, and any suggestion is helpful.