| 985 | } |
| 986 | |
| 987 | void _serverPanic(const char *file, int line, const char *msg, ...) { |
| 988 | va_list ap; |
| 989 | va_start(ap,msg); |
| 990 | char fmtmsg[256]; |
| 991 | vsnprintf(fmtmsg,sizeof(fmtmsg),msg,ap); |
| 992 | va_end(ap); |
| 993 | |
| 994 | bugReportStart(); |
| 995 | serverLog(LL_WARNING,"------------------------------------------------"); |
| 996 | serverLog(LL_WARNING,"!!! Software Failure. Press left mouse button to continue"); |
| 997 | serverLog(LL_WARNING,"Guru Meditation: %s #%s:%d",fmtmsg,file,line); |
| 998 | |
| 999 | if (server.crashlog_enabled) { |
| 1000 | #ifdef HAVE_BACKTRACE |
| 1001 | logStackTrace(NULL, 1); |
| 1002 | #endif |
| 1003 | printCrashReport(); |
| 1004 | } |
| 1005 | |
| 1006 | // remove the signal handler so on abort() we will output the crash report. |
| 1007 | removeSignalHandlers(); |
| 1008 | bugReportEnd(0, 0); |
| 1009 | } |
| 1010 | |
| 1011 | void bugReportStart(void) { |
| 1012 | pthread_mutex_lock(&bug_report_start_mutex); |
nothing calls this directly
no test coverage detected