glibc detected - error
I have written a client/server app that works fine when I run both in a local machine, but once I try to run the server on a remote machine I get the following error:
*** glibc detected *** free(): invalid next size (normal): 0x0804d828 ***
Anybody have an idea of why this is happening? I've read on several forums that this may be caused by allocating less memory than what is required.
looks like memory overrun in the block allocated by malloc
You probably wrote outside the bounds of allocated space. It could be because of allocating less memory than required, or it could be a bug where you accidentally access memory you shouldn't be. It sounds like you're likely on a system that is supported by Valgrind, a fantastic debugging tool that can help pinpoint exactly where your memory errors are occurring. I would definitely give it a shot; but don't forget to build your program with the -g flag for debugging.