Assert failure when calling notify()


We’ve migrated our agent from 32-bit Linux to 64-bit and are encountering a crash when sending an SNMPv2 trap via notify(). The backtrace shows

#0 0x00007ff95b56fb0a in raise () from /usr/lib/
#1 0x00007ff95b570c7f in abort () from /usr/lib/
#2 0x00007ff95b56885a in ?? () from /usr/lib/
#3 0x00007ff95b5688d2 in __assert_fail () from /usr/lib/
#4 0x00007ff95b8fa41d in pthread_mutex_lock () from /usr/lib/
#5 0x00007ff95ce1826f in Agentpp::Synchronized::lock() () from /opt/Platform/ThirdParty/lib/
#6 0x00007ff95cb2f082 in Agentpp::lock::Lock(Agentpp::Synchronized&) () from /opt/Platform/ThirdParty/lib/
#7 0x00007ff95cb2f357 in Agentpp::AgentXQueue::add(Agentpp::AgentXPdu*) () from /opt/Platform/ThirdParty/lib/
#8 0x00007ff95cb53a7e in Agentpp::SubAgentXMib::notify(Snmp_pp::OctetStr const&, Agentpp::Oidx const&, Agentpp::Vbx*, int, unsigned int) ()
from /opt/Platform/ThirdParty/lib/
#9 0x000000000044efcd in Agentpp::bitFailureTrap::notify (this=this@entry=0x685990 , context=…, vbs=vbs@entry=0xd542b8, sz=sz@entry=7)

Does the mib object need to be locked (via mib->lock()) first?

The MibEntry needs to be locked only

  1. if it is writable
  2. if it might change the Vbs instance provided to the notify(…) method.

What AgentX++, AGENT++, and SNMP++ version are you using?

Thanks for the reply. I’ll check to ensure no other thread is modifying the Vbs instance.
Our versions are : agent+±4.1.0, agentx+±2.1.0, snmp+±3.3.10