Commit 77b21bef authored by Eric Cano's avatar Eric Cano
Browse files

Added segfault when getting an exception in BackendPopulator::~BackendPopulator().

This will give us a core dump with valuable context. Without this change, the process already
core dump, but we don't get exception info.
parent 4b747bc3
......@@ -46,10 +46,18 @@ BackendPopulator::BackendPopulator(cta::objectstore::Backend & be,
// Destructor
//------------------------------------------------------------------------------
BackendPopulator::~BackendPopulator() throw() {
Agent agent(m_agentReference.getAgentAddress(), m_backend);
cta::objectstore::ScopedExclusiveLock agl(agent);
agent.fetch();
agent.removeAndUnregisterSelf();
try {
Agent agent(m_agentReference.getAgentAddress(), m_backend);
cta::objectstore::ScopedExclusiveLock agl(agent);
agent.fetch();
agent.removeAndUnregisterSelf();
} catch (cta::exception::Exception & ex) {
// We have an exception (we should not), let's core dump.
*((int*)nullptr)=0;
} catch (std::exception & ex) {
// We have an exception (we should not), let's core dump.
*((int*)nullptr)=0;
}
}
//------------------------------------------------------------------------------
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment