mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-27 00:04:35 +00:00
Crash handler may be not installed.
This commit is contained in:
parent
54fa21bcbb
commit
61c9e8e6d8
@ -1173,6 +1173,7 @@ Profiler::Profiler()
|
|||||||
#endif
|
#endif
|
||||||
, m_paramCallback( nullptr )
|
, m_paramCallback( nullptr )
|
||||||
, m_queryData( nullptr )
|
, m_queryData( nullptr )
|
||||||
|
, m_crashHandlerInstalled( false )
|
||||||
{
|
{
|
||||||
assert( !s_instance );
|
assert( !s_instance );
|
||||||
s_instance = this;
|
s_instance = this;
|
||||||
@ -1249,6 +1250,8 @@ void Profiler::SpawnWorkerThreads()
|
|||||||
sigaction( SIGABRT, &crashHandler, &m_prevSignal.abrt );
|
sigaction( SIGABRT, &crashHandler, &m_prevSignal.abrt );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
m_crashHandlerInstalled = true;
|
||||||
|
|
||||||
#ifdef TRACY_HAS_CALLSTACK
|
#ifdef TRACY_HAS_CALLSTACK
|
||||||
InitCallstack();
|
InitCallstack();
|
||||||
#endif
|
#endif
|
||||||
@ -1261,13 +1264,16 @@ Profiler::~Profiler()
|
|||||||
m_shutdown.store( true, std::memory_order_relaxed );
|
m_shutdown.store( true, std::memory_order_relaxed );
|
||||||
|
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
sigaction( SIGPWR, &m_prevSignal.pwr, nullptr );
|
if( m_crashHandlerInstalled )
|
||||||
sigaction( SIGILL, &m_prevSignal.ill, nullptr );
|
{
|
||||||
sigaction( SIGFPE, &m_prevSignal.fpe, nullptr );
|
sigaction( SIGPWR, &m_prevSignal.pwr, nullptr );
|
||||||
sigaction( SIGSEGV, &m_prevSignal.segv, nullptr );
|
sigaction( SIGILL, &m_prevSignal.ill, nullptr );
|
||||||
sigaction( SIGPIPE, &m_prevSignal.pipe, nullptr );
|
sigaction( SIGFPE, &m_prevSignal.fpe, nullptr );
|
||||||
sigaction( SIGBUS, &m_prevSignal.bus, nullptr );
|
sigaction( SIGSEGV, &m_prevSignal.segv, nullptr );
|
||||||
sigaction( SIGABRT, &m_prevSignal.abrt, nullptr );
|
sigaction( SIGPIPE, &m_prevSignal.pipe, nullptr );
|
||||||
|
sigaction( SIGBUS, &m_prevSignal.bus, nullptr );
|
||||||
|
sigaction( SIGABRT, &m_prevSignal.abrt, nullptr );
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef TRACY_HAS_SYSTEM_TRACING
|
#ifdef TRACY_HAS_SYSTEM_TRACING
|
||||||
|
@ -817,6 +817,7 @@ private:
|
|||||||
struct sigaction pwr, ill, fpe, segv, pipe, bus, abrt;
|
struct sigaction pwr, ill, fpe, segv, pipe, bus, abrt;
|
||||||
} m_prevSignal;
|
} m_prevSignal;
|
||||||
#endif
|
#endif
|
||||||
|
bool m_crashHandlerInstalled;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user