Bug 736580 - snmpd memory leak when AgentX subagent disconnects while processing a request
Summary: snmpd memory leak when AgentX subagent disconnects while processing a request
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: net-snmp
Version: 6.2
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Jan Safranek
QA Contact: Dalibor Pospíšil
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-09-08 07:24 UTC by Karel Srot
Modified: 2012-06-20 07:21 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
In the previous update, we fixed snmpd crashing when an AgentX subagent disconnected in the middle of processing a requests. The fix was imperfect and left a small memory leak. In this update, this memory leak is fixed.
Clone Of:
Environment:
Last Closed: 2012-06-20 07:21:36 UTC


Attachments (Terms of Use)
valgrind output (96.67 KB, text/plain)
2011-09-08 07:24 UTC, Karel Srot
no flags Details


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2012:0876 normal SHIPPED_LIVE Moderate: net-snmp security and bug fix update 2012-06-19 19:28:47 UTC

Description Karel Srot 2011-09-08 07:24:26 UTC
Created attachment 522051 [details]
valgrind output

Description of problem:

Qa found out that if the AgentX subagent disconnects while processing  a
request, the request then leaks a bit of memory in the master snmpd (approx 44
bytes per such request).

Valgrind report:
==8326==    at 0x4A04A28: calloc (vg_replace_malloc.c:467)
==8326==    by 0x4C33E6A: netsnmp_create_delegated_cache (agent_handler.c:713)
==8326==    by 0x4C36BC9: agentx_master_handler (master.c:591)
==8326==    by 0x4C3642E: netsnmp_call_handlers (agent_handler.c:440)
==8326==    by 0x4C26710: handle_var_requests (snmp_agent.c:2611)
==8326==    by 0x4C28395: handle_pdu (snmp_agent.c:3407)
==8326==    by 0x4C2A7EF: netsnmp_handle_request (snmp_agent.c:3203)
==8326==    by 0x4C2B2A9: handle_snmp_packet (snmp_agent.c:1929)
==8326==    by 0x6AD6867: _sess_process_packet (snmp_api.c:5604)
==8326==    by 0x6AD71FF: _sess_read (snmp_api.c:6043)
==8326==    by 0x6AD8048: snmp_sess_read2 (snmp_api.c:6075)
==8326==    by 0x6AD810A: snmp_read2 (snmp_api.c:5667)

I assume the AgentX subagents disconnect very rarely and this memory leak
happens only in very exceptional case, so I left the leak there for now, while
working on it upstream. Please reopen the bug if you'r AgentX disconnects often
so the leak might matter.

valgrind output attached.

related to bug 729738

Comment 3 Jan Safranek 2012-02-07 13:58:48 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
In the previous update, we fixed snmpd crashing when an AgentX subagent disconnected in the middle of processing a requests. The fix was imperfect and left a small memory leak. In this update, this memory leak is fixed.

Comment 8 errata-xmlrpc 2012-06-20 07:21:36 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2012-0876.html


Note You need to log in before you can comment on or make changes to this bug.