From: Toth, G. S <gre...@bo...> - 2002-11-13 01:51:07
|
We are seeing snmp_parse_oid cause a multi-threaded SNMP management application to crash. The main thread initializes snmp and supposidly does the mib parsing with the following code: init_snmp(""); snmp_session *temp= new snmp_session; snmp_sess_init(temp); delete temp; It then creates a second thread which creates a c++ object which opens a single session snmp session pointing to the remote agent and returns a reference to this object back to the original thread. The second thread is then destroyed but the c++ object's destructor is not called so that it still exists and the first thread still has access to it. Later the first thread attempts to send a snmp request from this object. The application crashes during snmp_parse_oid in the c++ object due to a memory violation. We can see the parameters being passed to snmp_parse_oid using the debugger on the core file and they look ok. Is there any way the MIB tree that got created by the snmp_sess_init in the main thread could have been corrupted? This is about the only thing I can think that could be causing this to happen. |