[AGENT++] Potential deadlocks for SNMP Subagents ...
Frank Fock
fock at agentpp.com
Tue May 17 19:51:14 CEST 2005
Hi Jens,
I do not think that (1) would cause any deadlock, because Mib::find_next
is only called when mib->lock() is acquired.
Thanks for reporting (2) it has been fixed by AgentX++v1.4.12b.
Best regards,
Frank
Jens Engel wrote:
>APPLIES-TO: SNMP Subagents (connected via AgentX)
>IN: file:agentx_subagent.cpp (AgentX++ v1.4.11)
>NOTE: Problematic lines marked with "XXX".
>
>1. SubAgentXMib::find_next(): If logging is more verbose (DEADLOCK OCCURs):
>
>int SubAgentXMib::find_next(MibContext* context, const Oidx& oid,
>MibEntryPtr& entry, Request* req, const int reqind)
>{
> int err = Mib::find_next(context, oid, entry, req, reqind);
> if (err == SNMP_ERROR_SUCCESS) {
> ...
> // test for valid range
> if (range.get_lower() <= range.get_upper()) {
> if (!is_complex_node(entry)) {
> if (!range.includes(*entry->key()))
> return sNMP_SYNTAX_NOSUCHOBJECT;
> }
> else {
> LOG_BEGIN(DEBUG_LOG | 3);
> LOG("SubAgentXMib: find next
>(lower)(upper)(incl)(succ)");
> LOG(range.get_lower().get_printable());
> LOG(range.get_upper().get_printable());
> LOG((range.is_lower_included()) ? "TRUE":"FALSE");
>XXX // XXX-JE-PATCH: NO; find_succ locks thread => deadlock
>!!
>XXX // LOG(entry->find_succ(oid, req).get_printable());
> LOG_END;
>
>2. In process_response(): Missing queue->unlock()??? (by Inspection)
>
>void SubAgentXMib::process_response(AgentXRequest* r)
>{
> ...
> queue->lock();
> ...
> if (!pending) {
> ...
>XXX queue->unlock(); //< XXX-JE-PATCH: Is this not missing here
>(before return)???
> return;
> ...
>}
>
>Jens Engel, EG/FW-BTC4, Marconi Communications GmbH.
>Tel. ++49 7191 13-4702
>mailto:Jens.Engel at marconi.com
>
>
>_______________________________________________
>AGENTPP mailing list
>AGENTPP at agentpp.org
>http://lists.agentpp.org/mailman/listinfo/agentpp
>
>
>
More information about the AGENTPP
mailing list