Fix comment
This commit is contained in:
@@ -399,13 +399,13 @@ void ForceCrashHandler( const char *reason )
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if defined(LINUX)
|
#if defined(LINUX)
|
||||||
void ForceCrashHandlerDeadlock( CString reason, const BacktraceContext *ctx )
|
void ForceCrashHandlerDeadlock( const CString& reason, const BacktraceContext *ctx )
|
||||||
{
|
{
|
||||||
CrashData crash;
|
CrashData crash;
|
||||||
memset( &crash, 0, sizeof(crash) );
|
memset( &crash, 0, sizeof(crash) );
|
||||||
|
|
||||||
crash.type = CrashData::FORCE_CRASH_DEADLOCK;
|
crash.type = CrashData::FORCE_CRASH_DEADLOCK;
|
||||||
strncpy( crash.reason, reason, sizeof(crash.reason) );
|
strncpy( crash.reason, reason, min(sizeof(crash.reason) - 1, reason.length()) );
|
||||||
crash.reason[ sizeof(crash.reason)-1 ] = 0;
|
crash.reason[ sizeof(crash.reason)-1 ] = 0;
|
||||||
|
|
||||||
GetBacktrace( crash.BacktracePointers, BACKTRACE_MAX_SIZE, NULL );
|
GetBacktrace( crash.BacktracePointers, BACKTRACE_MAX_SIZE, NULL );
|
||||||
@@ -414,20 +414,30 @@ void ForceCrashHandlerDeadlock( CString reason, const BacktraceContext *ctx )
|
|||||||
RunCrashHandler( &crash );
|
RunCrashHandler( &crash );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* iCrashHandle comes from ThreadImpl_Pthreads::GetCrashHandle. */
|
/* iCrashHandle comes from ThreadImpl_Pthreads::GetThreadId. */
|
||||||
void ForceCrashHandlerDeadlock( CString reason, uint64_t iCrashHandle )
|
void ForceCrashHandlerDeadlock( const CString& reason, uint64_t iCrashHandle )
|
||||||
{
|
{
|
||||||
BacktraceContext ctx;
|
BacktraceContext ctx;
|
||||||
if( !GetThreadBacktraceContext( iCrashHandle, &ctx ) )
|
if( !GetThreadBacktraceContext( iCrashHandle, &ctx ) )
|
||||||
{
|
{
|
||||||
reason += "; GetThreadBacktraceContext failed";
|
reason += "; GetThreadBacktraceContext failed";
|
||||||
ForceCrashHandler( reason );
|
ForceCrashHandler( reason );
|
||||||
} else {
|
|
||||||
ForceCrashHandlerDeadlock( reason, &ctx );
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
ForceCrashHandlerDeadlock( reason, &ctx );
|
||||||
|
|
||||||
_exit(1);
|
_exit(1);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
void ForceCrashHandlerDeadlock( const CString& reason, const BacktraceContext *ctx )
|
||||||
|
{
|
||||||
|
ForceCrashHandler( reason );
|
||||||
|
}
|
||||||
|
|
||||||
|
void ForceCrashHandlerDeadlock( const CString& reason, uint64_t iCrashHandle )
|
||||||
|
{
|
||||||
|
ForceCrashHandler( reason );
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* XXX test for recursive crashes here (eg. GetBacktrace crashing) */
|
/* XXX test for recursive crashes here (eg. GetBacktrace crashing) */
|
||||||
|
|||||||
Reference in New Issue
Block a user