#include <FPEAuditor.h>
Definition at line 33 of file FPEAuditor.h.
◆ FpeNode_t
◆ FpeStack_t
◆ anonymous enum
Enumerator |
---|
FPEAUDITOR_OVERFLOW | |
FPEAUDITOR_INVALID | |
FPEAUDITOR_DIVBYZERO | |
FPEAUDITOR_ARRAYSIZE | |
Definition at line 81 of file FPEAuditor.h.
◆ FPEAuditor()
FPEAuditor::FPEAuditor |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
Constructor.
Definition at line 62 of file FPEAuditor.cxx.
70 "Flag to configure, how many stack traces in case of FPE are printed. "
71 "Default: Zero, just report that FPE has happened. "
72 "After collecting the stacktrace, the code has to modify the mcontext_t "
73 "struct to ignore FPEs for the rest of the processing of the algorithm/service "
74 "This part is highly non-portable!" );
76 declareProperty(
"Nstacklines",
m_Nstacklines,
"Limit how deep we dive into the stack");
◆ ~FPEAuditor()
FPEAuditor::~FPEAuditor |
( |
| ) |
|
|
virtual |
◆ add_fpe_node()
void FPEAuditor::add_fpe_node |
( |
| ) |
|
|
private |
add an fpe node
Definition at line 278 of file FPEAuditor.cxx.
281 int raised = fetestexcept(FE_OVERFLOW | FE_INVALID | FE_DIVBYZERO);
285 feclearexcept(FE_ALL_EXCEPT);
294 FPEAudit::mask_fpe();
◆ after()
void FPEAuditor::after |
( |
const std::string & |
event, |
|
|
const std::string & |
name, |
|
|
const EventContext & |
ctx, |
|
|
const StatusCode & |
sc |
|
) |
| |
|
overridevirtual |
◆ before()
void FPEAuditor::before |
( |
const std::string & |
event, |
|
|
const std::string & |
name, |
|
|
const EventContext & |
ctx |
|
) |
| |
|
overridevirtual |
◆ finalize()
StatusCode FPEAuditor::finalize |
( |
| ) |
|
|
overridevirtual |
◆ initialize()
StatusCode FPEAuditor::initialize |
( |
| ) |
|
|
overridevirtual |
◆ InstallHandler()
void FPEAuditor::InstallHandler |
( |
| ) |
|
|
private |
Definition at line 116 of file FPEAuditor.cxx.
122 ATH_MSG_WARNING(
"Collecting stack traces for FPES is not supported on aarch64");
127 struct sigaction act;
128 memset(&act, 0,
sizeof act);
129 act.sa_sigaction = FPEAudit::fpe_sig_action;
130 act.sa_flags = SA_SIGINFO;
131 if ( sigaction(SIGFPE, &act, &FPEAudit::s_oldactHandler) != 0 )
133 ATH_MSG_WARNING (
"Printing stacktraces on FPE requested, but unable to install signal handler ! Switched off !");
139 FPEAudit::unmask_fpe();
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ pop_fpe_node()
void FPEAuditor::pop_fpe_node |
( |
| ) |
|
|
private |
pop an fpe node
Definition at line 299 of file FPEAuditor.cxx.
303 throw std::runtime_error(
"inconsistent fpe-stack");
315 FPEAudit::unmask_fpe();
◆ report_fpe()
void FPEAuditor::report_fpe |
( |
const std::string & |
step, |
|
|
const std::string & |
caller, |
|
|
const EventContext & |
ctx |
|
) |
| |
|
private |
report fpes which happened during step 'step' on behalf of 'caller'
Definition at line 198 of file FPEAuditor.cxx.
203 int raised = fetestexcept(FE_OVERFLOW | FE_INVALID | FE_DIVBYZERO);
205 std::stringstream evStr;
207 evStr <<
" on event " << ctx.eventID().event_number();
210 if (raised & FE_OVERFLOW) {
221 this->
msg(
MSG::INFO) <<
"FPE stacktrace " << j <<
" :\n";
228 if (raised & FE_INVALID) {
240 this->
msg(
MSG::INFO) <<
"FPE stacktrace " << j <<
" :\n";
246 if (raised & FE_DIVBYZERO) {
257 this->
msg(
MSG::INFO) <<
"FPE stacktrace " << j <<
" :\n";
271 fprintf(
stderr,
"too many SIGFPE detected, will be uninstalling signal handler\n");
◆ UninstallHandler()
void FPEAuditor::UninstallHandler |
( |
| ) |
|
|
private |
Definition at line 149 of file FPEAuditor.cxx.
154 feclearexcept(FE_ALL_EXCEPT);
156 FPEAudit::mask_fpe();
◆ m_CountFPEs
◆ m_env
The FP environment before we initialize.
Definition at line 96 of file FPEAuditor.h.
◆ m_nexceptions
std::atomic<int> FPEAuditor::m_nexceptions |
|
private |
◆ m_Nstacklines
unsigned int FPEAuditor::m_Nstacklines =100 |
|
private |
◆ m_NstacktracesOnFPE
unsigned int FPEAuditor::m_NstacktracesOnFPE =0 |
|
private |
◆ s_fpe_stack
a stack of FPE exceptions which have been raised
Definition at line 79 of file FPEAuditor.h.
The documentation for this class was generated from the following files:
void report_fpe(const std::string &step, const std::string &caller, const EventContext &ctx)
report fpes which happened during step 'step' on behalf of 'caller'