Re: Vague world crash
Posted: Wed Aug 19, 2015 3:55 pm
So here's my first observation; None of the existing thread starters have Loggers. Yours does. The crash is in a memcpy, which we've seen dozens of times when LogWrite freaks out. There probably is no stack for this crashing thread since the thread just started up. I will comment these Loggers out and run the server for a while. If it's stable again, it's back to you to figure out why.
Code: Select all
/**
* @brief This is the thread function for the chunk regen tick thread.
*
* @author Ratief
* @date 18 Aug 2015
*/
void ChunkRegenThread(void *data) {
timem_t start_time = 0;
timem_t end_time = 0;
timem_t diff_time = 0;
ChunkServer *chunk = (ChunkServer *)data;
// A bit of logging
LogTrace(LOG_CHUNK, 1, "Starting regen thread for chunk %s.", chunk->GetChunkDisplayName());
// Set that we are running
chunk->regen_thread_active = true;
while (chunk->regen_thread_running) {
// Get the current microtime
start_time = TimeMS();
chunk->ProcessRegen();
// Get the end time
end_time = TimeMS();
// Sleep for the appropriate time
diff_time = end_time-start_time;
SleepMS(REGEN_TICK_INTERVAL-diff_time);
}
// A bit of logging
LogTrace(LOG_CHUNK, 1, "Exiting regen thread for chunk %s.", chunk->GetChunkDisplayName());
// Set that we are NOT running
chunk->regen_thread_active = false;
}