[AGENT++] process_request() crasch
Daniel Hägg
Daniel.Hagg at factum.se
Tue Dec 6 13:39:17 CET 2005
Hi,
I have an SNMP agent that has been built using snmp++ v3.1.6 and agent++ v3.5.3. I have not developed this agent myself so I have very little knowledge of the libraries. My problem is that the agent leaks memory and I have to find a solution. I have studied the release notes for the latest versions of the libraries (agent++ v3.5.24 and snmp++ v3.2.18) and found that a couple of memory leaks have been fixed. Therefore I have tried to re-compile the agent using the latest versions. The result so far is a crash somewhere within Mib::process_request() the first time a SNMP request is received. Can anyone give me a hint of what the problem might be?
I only get a "killed" message from the OS and nothing else. The only method of debugging available to me is to insert print statements at strategic places in the code.
The main loop of the request handler looks like this:
while (!m_bStop)
{
req = reqList->receive(2);
if (req)
m_pMib->process_request(req);
else
m_pMib->cleanup();
// Check if community has changed
// Double check lock algorithm for performance
if (m_varChanged)
{ // variables are probably changed
m_guardVar.enterMutex();
// no one can change flag now
if (m_varChanged)
{ // yes variables was changed
reqList->set_read_community(m_community.c_str());
reqList->set_write_community(m_community.c_str());
m_varChanged = false; // reset change flag
}
m_guardVar.leaveMutex();
}
}
More information about the AGENTPP
mailing list