This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
SNMP memory leak
- From: "Laurie Gellatly" <laurie dot gellatly at netic dot com>
- To: <ecos-discuss at sources dot redhat dot com>
- Date: Sun, 25 Mar 2012 20:56:46 +1100
- Subject: [ECOS] SNMP memory leak
Hi All,
If your device is running the SNMP agent I suggest you read this:
I've been made aware of a memory leak in the SNMP agent for eCos.
This thread http://sourceware.org/ml/ecos-discuss/2007-06/msg00241.html
talks about a leak as well but does not clearly show the resolution.
To find out if you have the issue do this:
1) If you have not already then devise a method to show mall.fordblks from
mall=mallinfo() and note the amount of free memory shown in the running
device.
2) run this command against your device with a community string unknown to
your device: snmpget -c badpublic 192.168.1.1 .1.3.6.1.2.1.1.5.0 ; replace
192.168.1.1 with your device's IP
3) do mall=mallinfo() again and note the mall.fordblks afterwards and you
will see your free memory has reduced. Repeat these steps and it will
continue to reduce till it exhausts memory.
If you use the correct SNMP community string then memory is not leaked.
So I updated and modified snmp_agent.c & .h and snmp_api.c & .h from
ucd_snmp 4.2.7 (as implied in the thread above).
Although it fixed the leak, SNMP traps sent from the device are now broken.
(I'm still tracking it down but I'm guessing it's a memory issue as well).
Have you checked your own devices to see if you have this problem?
Has anyone made changes to the SNMP files and fixed both issues and are you
willing to share?
I'll happily post the new version I've tried if that will help - you just
can't drop the 4.2.7 files in to replace the old (that would be too easy).
Thanks ...Laurie:{)
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss