[AGENT++] Double free ... (memory corruption)

Jens Rehsack rehsack at googlemail.com
Tue Oct 26 10:04:50 CEST 2010


Hi all,

I received during a long-term test a memory corruption:

*** glibc detected *** ./src/smart-snmpd: double free or corruption
(fasttop): 0xb3d00f68 ***
======= Backtrace: =========
/lib/tls/i686/cmov/libc.so.6(+0x6b591)[0x5b2591]
/lib/tls/i686/cmov/libc.so.6(+0x6cde8)[0x5b3de8]
/lib/tls/i686/cmov/libc.so.6(cfree+0x6d)[0x5b6ecd]
/usr/lib/libstdc++.so.6(_ZdlPv+0x21)[0x44e741]
/sysmgmt/opt/smart-snmp/lib/libagent++.so.35(_ZN7Agentpp21OidxPtrEntryPtrAVLMap3delEPNS_4OidxE+0x6d)[0xe1676d]
/sysmgmt/opt/smart-snmp/lib/libagent++.so.35(_ZN7Agentpp8MibTableD0Ev+0x1e1)[0xe26ce1]
./src/smart-snmpd[0x807c7c8]
./src/smart-snmpd[0x807ad12]
./src/smart-snmpd[0x8080439]
/sysmgmt/opt/smart-snmp/lib/libagent++.so.35(_ZN7Agentpp14thread_starterEPv+0xbd)[0xe69d1d]
/lib/tls/i686/cmov/libpthread.so.0(+0x596e)[0x93596e]
/lib/tls/i686/cmov/libc.so.6(clone+0x5e)[0x614a4e]

Using objdump I could guess the source location:
include/agent_pp/List.h:829 - looks for me (quick look)
as a threading issue (is the access to _need_rebalancing locked? I
didn't find where ...)

Wouldn't it reasonable to use member variables? Or much better: std::map<>?

/Jens



More information about the AGENTPP mailing list