Robert,

thank you for the patch, but unfortunately it didn't work (I applied it against 5.1.2).

Valgrind is still complaining about the invalid free():


==32669== Invalid free() / delete / delete[] ==32669== at 0x1B902460: free (vg_replace_malloc.c:153) ==32669== by 0x1BBABF2F: clear_callback (callback.c:380) ==32669== by 0x1BB7FEC6: snmp_shutdown (snmp_api.c:848) ==32669== by 0x8051BC7: snmpAgentThread (snmp.c:1086) ==32669== Address 0x1BE9B498 is 0 bytes inside a block of size 220 free'd ==32669== at 0x1B902460: free (vg_replace_malloc.c:153) ==32669== by 0x1BB8191C: snmp_free_session (snmp_api.c:1693) ==32669== by 0x1BB81AF4: snmp_sess_close (snmp_api.c:1773) ==32669== by 0x1BB81C72: snmp_close (snmp_api.c:1803) ==32669== by 0x1BA87174: subagent_shutdown (subagent.c:612) ==32669== by 0x1BBABA92: snmp_call_callbacks (callback.c:224) ==32669== by 0x1BB7FE99: snmp_shutdown (snmp_api.c:837) ==32669== by 0x8051BC7: snmpAgentThread (snmp.c:1086)


When I don't call snmp_shutdown() my application always works fine, but if I call it my application locks in random places after calling it. The only thing Valgrind is complaining is about the invalid free() in net-snmp.



Regards, Ivens


Robert Story (Coders) wrote:
On Wed, 20 Oct 2004 16:02:01 -0200 Ivens wrote:
IP> Robert Story (Coders) wrote:
IP> > On Tue, 19 Oct 2004 17:07:56 -0200 Ivens wrote:
IP> > IP> Robert Story (Coders) wrote:
IP> > IP> > On Tue, 19 Oct 2004 14:58:30 -0200 Ivens wrote:
IP> > IP> What if I shut everything down before restarting as an agent? Would IP> > IP> calling snmp_shutdown() solve the problem?
IP> > IP> > I was hoping you wouldn't ask that.
IP> > IP> > In theory, yes, that should work. However, since the agent exists when
IP> > shutting down, not a whole lot of work has gone into testing and working
IP> > out the kinks of snmp_shutdown. IP> IP> I didn't dig deep into the code but I ran my application on Valgrind to IP> try to detect memory problems and the only thing I got was an invalid IP> free() in snmp_shutdown(). Below is Valgrind output with the backtrace:
IP> IP> ==31937== Invalid free() / delete / delete[]
IP> ==31937== by 0x1BBABDC7: clear_callback (callback.c:297)


Try the patch I just attached to this bug report, and see if it helps:

http://sourceforge.net/tracker/index.php?func=detail&aid=1027711&group_id=12694&atid=112694



--
Ivens Porto
OSE - Open Systems Engineering
http://www.ose.com.br
Phone: (55) 34 - 3214-5995
Fax:   (55) 34 - 3214-5994
Cel:   (55) 34 - 8816-9942


------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ Net-snmp-coders mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to