When I write a C program, I encountered a problem that is as follows:
malloc.c:3074: sYSMALLOc: Assertion (old_top == (((mbinptr) (((char *) &((av
It seems like the administration kept for memory allocation has been corrupted. My guess would be that you have something like a buffer overflow somewhere before this error occurs.
As the error is a result of an earlier problem (assuming I'm right), this can be a somewhat difficult problem to fix. Perhaps a tool like valgrind can help you to detect incorrect writes to memory. If you have a small program that demonstrates the problem, I would suggest adding that code to your question.