Twice now my server has crashed after several days of running on this line.
int randomValue = rand() % m_list.size();
where m_list is
std::list<int> m_list;
The crash is
Program terminated with signal 8, Arithmetic exception.
getting the size of a list should be guaranteed to not be negative. What could cause this crash? Can something with rand be the cause? I seed rand at the start of my server with
srand(time(NULL));
Any tips are appreciated!