[AGENT++] Core dump related to rows being removed from agentX tables?

Frank Fock fock at agentpp.com
Mon Apr 7 17:02:18 CEST 2008


Hello John,

With AGENT++ (and AgentX++) any access to a table's (or leaf's)
data must be synchronized. Some methods are already synchronized
which is documented in their method documentation.

Most methods are not synchronized. So those methods can be called
from within a synchronized method and outside such a method if
you are sure that this is safe.

Shortly spoken, to be thread-safe use:

mib->lock_mib();
table->start_synch();
mib->unlock_mib();
table->remove_row(index);
table->end_synch();

Best regards,
Frank Fock


john.edmonds at bt.com wrote:
> Hello Frank,
>  
> Will you have any more information for us on this issue as this core dump problem is currently preventing us from deploying the code?
>  
> Best regards,
> John Edmonds
> 
> ________________________________
> 
> From: Edmonds,J,John,JGFTX C
> Sent: Thu 03/04/2008 12:03
> To: Frank Fock
> Cc: agentpp at agentpp.org
> Subject: RE: [AGENT++] Core dump related to rows being removed from agentX tables?
> 
> 
> Hi Frank,
>  
> No, I'm not explicitly calling the functions you mention.  I'm using the following, for example, to create tables and add and remove rows.   I based my code on the examples in the AgentX++ v1.4 documentation. 
>  
> ipsiRtpSenderEntry = new rtpSenderEntry("",mib);
> mib->add_no_reg(ipsiRtpSenderEntry);
> 
> ipsiRtpSenderEntry->allocate_index(index)
> 
> ipsiRtpSenderEntry->remove_row(index);
> 
> From your e-mail it sounds like I might be missing something fundamental.   I guess I had assumed any mutex locking was done inside the above function calls.  Where/how do I make the calls you suggest?  Are there some documented examples I can follow?
>  
> Best regards,
> John Edmonds (BT)
>  
> 
> ________________________________
> 
> From: Frank Fock [mailto:fock at agentpp.com]
> Sent: Wed 02/04/2008 22:01
> To: Edmonds,J,John,JGFTX C
> Cc: agentpp at agentpp.org
> Subject: Re: [AGENT++] Core dump related to rows being removed from agentX tables?
> 
> 
> 
> Hi John,
> 
> How do you remove the rows from the table?
> Are you calling lock_mib() and table->start_synch()
> before removing the rows?
> 
> Best regards,
> Frank
> 
> john.edmonds at bt.com wrote:
>> Hi,
>>
>> I have a setup that works most of the time, but occasionally core dumps (under linux on PPC).  I suspect that it is somehow related to removing rows from tables (or multiple rows), when I don't remove table rows I never seem to get core dumps.  I am running an AgentX++ sub agent with Net-SNMP 5.4.1 master agent.
>>
>> agent++ v3.5.27.b
>> agentX++ v1.4.15
>> snmp++ v3.2.21.a
>>
>> This a stack backtrace I got from one core dump, the crash occurs at #0, List.h line 1154. Looks like a "get_next"...
>>
>> #7 thread_starter () at threads.cpp:486
>> #6 Agentpp::TaskManager::run () at threads.cpp:742
>> #5 Agentpp::MibTask::run () at threads.cpp:920
>> #4 Agentpp::SubAgentXMib::do_process_request () at agentx_subagent.cpp:926
>> #3 Agentpp::Mib::process_request () at mib.cpp:3297
>> #2 Agentpp::SubAgentXMib::find_next () at agentx_subagent.cpp:1072
>> #1 Agentpp::MibTable::find_succ () at mib.cpp:1753
>> #0 Agentpp::MibTable::find_next () at List.h:1154
>>
>> I have a MIB Browser that is constantly refreshing the display of the Tables.  Could there be a missing mutex somewhere between table row updates and browser SNMP gets perhaps?  Or confusion between a get on one table and row removal on another?
>>
>> Any suggestions as to what might be happening or what I could do to patch code to stop core dumps?  Add some bounds checking?
>>
>> Best regards,
>> John Edmonds (BT)
>>
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> AGENTPP mailing list
>> AGENTPP at agentpp.org
>> http://lists.agentpp.org/mailman/listinfo/agentpp
> 
> --
> AGENT++
> http://www.agentpp.com <http://www.agentpp.com/> 
> http://www.mibexplorer.com <http://www.mibexplorer.com/> 
> http://www.mibdesigner.com <http://www.mibdesigner.com/> 
> 
> 
> _______________________________________________
> AGENTPP mailing list
> AGENTPP at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/agentpp

-- 
AGENT++
http://www.agentpp.com
http://www.mibexplorer.com
http://www.mibdesigner.com



More information about the AGENTPP mailing list