| Return Type | Function name | Arguments |
|---|---|---|
| void | CatchSegVio | (int,) |
Declared in file: hzProcess.h
Defined in file : hzProcess.cpp
Function Logic:
Function body:
void CatchSegVio (int sig)
{
hzLogger* pLog ;
hzProcess* phz ;
void* pvArr[1024];
char** cpSym ;
uint32_t pid ;
uint32_t tid ;
uint32_t nSize ;
uint32_t nIndex ;
printf("SEGMENT VIOLATION\n") ;
fflush(stdout);
nSize = backtrace(pvArr, 1023);
cpSym = backtrace_symbols(pvArr, nSize);
pid = getpid() ;
tid = pthread_self() ;
pLog = GetThreadLogger() ;
phz = GetThreadInfo() ;
if (!pLog)
{
printf("1 CatchSegVio: %s\n", s_signals[sig]) ;
printf("1 CatchSegVio: Signal %d Process %u, thread %u\n", sig, pid, tid) ;
printf("1 Stack Trace is:\n") ;
for (nIndex = 0; nIndex < nSize ; nIndex++)
printf("%d - %s\n", nIndex, cpSym[nIndex]) ;
printf("1 Stack Trace end:\n") ;
fflush(stdout);
phz->StackTrace() ;
}
else
{
pLog->Out("2 CatchSegVio: %s\n", s_signals[sig]) ;
pLog->Out("2 CatchSegVio: Signal %d Process %u, thread %u\n", sig, pid, tid) ;
pLog->Out("2 Stack Trace is:\n") ;
for (nIndex = 0; nIndex < nSize ; nIndex++)
pLog->Out("%d - %s\n", nIndex, cpSym[nIndex]) ;
phz->StackTrace() ;
pLog->Out("2 Stack Trace end:\n") ;
}
exit(100);
}