What can cause segmentation fault? im making a server and after ~100 connections it shows that segmentation fault and exits...
Printable View
What can cause segmentation fault? im making a server and after ~100 connections it shows that segmentation fault and exits...
All sorts of things
- running off either end of allocated memory (trying to access the n'th index of an array with n elements)
- using memory before you allocate it (usually an uninitialised or NULL pointer)
- using memory after you've freed it (it might now belong to someone else)
- freeing the same thing twice
- freeing something which was never allocated
If you're on Linux, you might try valgrind or electic fence to help you find the problem.