-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MEMORY LEAKS in net-snmp 5.9 #300
Comments
Can you provide your snmpd.conf? The mteTrigger leak can only happen with certain configuration, so it would be helpful to know what specific configuration you used. |
Thanks for responding @fenner Please find the snmpd.conf below
|
I fixed few leaks with the code change below. Actually the entries which are failed to insert into the container are not getting freed which causes memory leak in tcpListenerTable.
@fenner @bvanassche It would be very helpful if we can get any update on mteTrigger leak. |
Hi @bvanassche @fenner |
Has it already been tried to run snmpd under Valgrind and with leak checking enabled (e.g. |
Thanks for the response @bvanassche I am seeing the leaks in netsnmp module when i run valgrind using below one.
And i gave a try with the valgrind arguments you mentioned, could see leaks in mtetrigger_run, netsnmp_query_walk and CONTAINER_INSERT_HELPER ( please refer for the o/p #300 (comment)) I have fixed leak in netsnmp_parse_args with the below code:
I tried debugging the mteTrigger leaks which i mentioned in the forum but unfortunately I didn't get any clue. Could you please check why the leaks are happening? |
The above change looks wrong to me. Please provide the leak complaint reported by Valgrind. |
Please find the valgrind log file |
This patch fixes the following Valgrind complaint: 14 bytes in 2 blocks are definitely lost in loss record 20 of 322 at 0x402F5ED: malloc (vg_replace_malloc.c:299) by 0x4548965: strdup (in /lib/libc-2.27.so) by 0x424D370: netsnmp_parse_args (in /lib/libnetsnmp.so.35.0.1) by 0x4064519: snmpd_parse_config_trapsess (in /lib/libnetsnmpagent.so.35.0.1) by 0x425287E: run_config_handler (in /lib/libnetsnmp.so.35.0.1) by 0x42539DB: read_config (in /lib/libnetsnmp.so.35.0.1) by 0x4253A5F: read_config_with_type_when (in /lib/libnetsnmp.so.35.0.1) by 0x4253D67: read_configs_optional (in /lib/libnetsnmp.so.35.0.1) by 0x4254642: read_configs (in /lib/libnetsnmp.so.35.0.1) by 0x4245849: init_snmp (in /lib/libnetsnmp.so.35.0.1) by 0x804A887: ??? (in /bin/snmpd) by 0x44E6E50: (below main) (in /lib/libc-2.27.so) See also net-snmp#300
This patch fixes the following Valgrind complaint: 14 bytes in 2 blocks are definitely lost in loss record 20 of 322 at 0x402F5ED: malloc (vg_replace_malloc.c:299) by 0x4548965: strdup (in /lib/libc-2.27.so) by 0x424D370: netsnmp_parse_args (in /lib/libnetsnmp.so.35.0.1) by 0x4064519: snmpd_parse_config_trapsess (in /lib/libnetsnmpagent.so.35.0.1) by 0x425287E: run_config_handler (in /lib/libnetsnmp.so.35.0.1) by 0x42539DB: read_config (in /lib/libnetsnmp.so.35.0.1) by 0x4253A5F: read_config_with_type_when (in /lib/libnetsnmp.so.35.0.1) by 0x4253D67: read_configs_optional (in /lib/libnetsnmp.so.35.0.1) by 0x4254642: read_configs (in /lib/libnetsnmp.so.35.0.1) by 0x4245849: init_snmp (in /lib/libnetsnmp.so.35.0.1) by 0x804A887: ??? (in /bin/snmpd) by 0x44E6E50: (below main) (in /lib/libc-2.27.so) See also net-snmp#300 . Fixes: 09f2cba ("libsnmp, netsnmp_parse_args(): Fix memory leaks in error paths")
Commit afc1854 should fix the community string leak. Please retest. |
See also net-snmp#300 .
I tested trap changes. Looks fine i don't see leak in community string. |
Please reopen if this needs further attention. |
@boggarapupriyanka , @fenner |
I ran valgrind over night on the package net-snmp 5.9 with v1/v2c configuration . Could see more memory leaks in the package.
@bvanassche @hardaker Please have a look and provide quick resolution
Please let us know if anything is required from our end.
The text was updated successfully, but these errors were encountered: