Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 5 product line. The current stable release is 5.10. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 576004

Summary: ipmitool lanplus SOL leaks memory on every SOL ack
Product: Red Hat Enterprise Linux 5 Reporter: Mark Goodwin <mgoodwin>
Component: OpenIPMIAssignee: Jan Safranek <jsafrane>
Status: CLOSED ERRATA QA Contact: qe-baseos-daemons
Severity: medium Docs Contact:
Priority: medium    
Version: 5.3CC: azelinka, rvokal, tsmetana
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
A serial console connected through LAN and activated with the command 'ipmitool sol activate' could consume all available memory resources. This update package fixes the issue.
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-01-13 23:31:10 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
plugs a memory leak on every SOL ack over lanplus
none
alternative patch none

Description Mark Goodwin 2010-03-23 00:19:58 UTC
Description of problem:

ipmitool leaks memory on every SOL ACK over the lanplus interface.
This causes problems for sites using the SOL console over a long
period of time. Verified patch available.

Version-Release number of selected component (if applicable):
OpenIPMI-tools-2.0.6-11 but all versions of ipmitool are believed
to be affected.

How reproducible:
100%.

Steps to Reproduce:
1. ipmitool -I lanplus -H somehost -U root -P somepasswd sol activate
2. run something that generates a lot of output on the SOL console
3. observe growing virtual size of the ipmitool process
  
Actual results:

When run with valgrind, the leak is immediately evident :

==1236== 23,042 bytes in 281 blocks are definitely lost in loss record 4 of 4
==1236==    at 0x4A05809: malloc (vg_replace_malloc.c:149)
==1236==    by 0x446A76: ipmi_lanplus_build_v2x_msg (lanplus.c:1577)
==1236==    by 0x447588: ipmi_lanplus_send_payload (lanplus.c:2172)
==1236==    by 0x448A89: ack_sol_packet (lanplus.c:2515)
==1236==    by 0x448BBA: ipmi_lanplus_recv_sol (lanplus.c:2534)
==1236==    by 0x412C18: ipmi_sol_activate (ipmi_sol.c:1544)
==1236==    by 0x41369E: ipmi_sol_main (ipmi_sol.c:1921)
==1236==    by 0x431D85: ipmi_main (ipmi_main.c:654)
==1236==    by 0x4044FF: main (ipmitool.c:122)

Expected results:
No memory leak.

Additional info:
Simple patch available, has been verified to fix the leak. Attached in next update. Test packages at http://people.redhat.com/mgoodwin/IT310534/

Comment 1 Mark Goodwin 2010-03-23 00:21:43 UTC
Created attachment 401890 [details]
plugs a memory leak on every SOL ack over lanplus

Comment 3 Jan Safranek 2010-03-29 13:54:48 UTC
Thanks for the patch. Even with it there seems to be something still leaking (much slower now):

==12878== 4,863 bytes in 57 blocks are definitely lost in loss record 6 of 6
==12878==    at 0x4A0515D: malloc (vg_replace_malloc.c:195)
==12878==    by 0x465187: ipmi_lanplus_build_v2x_msg (lanplus.c:1593)
==12878==    by 0x4662E8: ipmi_lanplus_send_payload (lanplus.c:2196)
==12878==    by 0x46670C: ipmi_lanplus_send_sol (lanplus.c:2397)
==12878==    by 0x419831: processSolUserInput (ipmi_sol.c:1443)
==12878==    by 0x419CC2: ipmi_sol_red_pill (ipmi_sol.c:1622)
==12878==    by 0x41A2B8: ipmi_sol_activate (ipmi_sol.c:1848)
==12878==    by 0x41A8B8: ipmi_sol_main (ipmi_sol.c:2039)
==12878==    by 0x443B69: ipmi_cmd_run (ipmi_main.c:211)
==12878==    by 0x445307: ipmi_main (ipmi_main.c:824)
==12878==    by 0x404B9E: main (ipmitool.c:126)

I'll look at it

Comment 4 Jan Safranek 2010-03-29 14:18:55 UTC
Created attachment 403302 [details]
alternative patch

This patch fixes both leaks.

Comment 7 Issue Tracker 2010-04-16 02:35:51 UTC
Event posted on 04-16-2010 11:35am JST by mfuruta

Hi Samukawa-san,

Thank you for your verification!

-==--==--==--==--==--==--==--==--==--==--==--==--==-
Memory leak did not occur after running for a day
after updated leak.patch (after updated
ipmitool-1.8.10-fix-sol-sack-memleak.patch) on RHEL5.3 GA
-==--==--==--==--==--==--==--==--==--==--==--==--==-

I'll let our engineering know that and flip back to Waiting on Tech.

Best Regards,
Masaki Furuta


Internal Status set to 'Waiting on Engineering'

This event sent from IssueTracker by mfuruta 
 issue 310534

Comment 13 Eva Kopalova 2010-12-20 12:05:35 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:
A serial console connected through LAN and activated with the command 'ipmitool sol activate' could consume all available memory resources. This update package fixes the issue.

Comment 15 errata-xmlrpc 2011-01-13 23:31:10 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0096.html