Bug 457179

Summary: mcstransd has some memory leaks.
Product: Red Hat Enterprise Linux 5 Reporter: ryo fujita <rfujita>
Component: mcstransAssignee: Daniel Walsh <dwalsh>
Status: CLOSED ERRATA QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: 5.2CC: jbastian, mkoci, rfujita, syeghiay, tao
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-01-20 22:07:49 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
Patch for mcstrans-0.2.7-1.el5
none
patch for mcstrans-0.2.11-1.fc9 none

Description ryo fujita 2008-07-30 01:57:43 UTC
Description of problem:
$subject

Version-Release number of selected component (if applicable):
mcstrans-0.2.7-1.el5

How reproducible:
Any

Steps to Reproduce:
1.run valgrind
# valgrind --leak-check=full --show-reachable=yes /sbin/mcstransd

2.issue (e.g.)id command. Because id command with -Z option connect /var/run/setrans/.setrans-unix
# id -Z

3.kill mcstransd
# kill `pidof valgrind`
[root@localhost ~]# ==5494== 
==5494== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 17 from 1)
==5494== malloc/free: in use at exit: 247 bytes in 12 blocks.
==5494== malloc/free: 321 allocs, 309 frees, 76,605 bytes allocated.
==5494== For counts of detected errors, rerun with: -v
==5494== searching for pointers to 12 not-freed blocks.
==5494== checked 125,692 bytes.
==5494== 
==5494== 16 bytes in 1 blocks are still reachable in loss record 1 of 2
==5494==    at 0x48054BB: realloc (vg_replace_malloc.c:306)
==5494==    by 0x31BF: main (mcstransd.c:312)
==5494== 
==5494== 
==5494== 231 bytes in 11 blocks are definitely lost in loss record 2 of 2
==5494==    at 0x48053C0: malloc (vg_replace_malloc.c:149)
==5494==    by 0x697D9F: strdup (in /lib/libc-2.5.so)
==5494==    by 0x1B8A: translate_raw (mcstrans.c:426)
==5494==    by 0x2239: trans_context (mcstrans.c:451)
==5494==    by 0x360A: main (mcstransd.c:88)
==5494== 
==5494== LEAK SUMMARY:
==5494==    definitely lost: 231 bytes in 11 blocks.
==5494==      possibly lost: 0 bytes in 0 blocks.
==5494==    still reachable: 16 bytes in 1 blocks.
==5494==         suppressed: 0 bytes in 0 blocks.
  
Actual results:
231 bytes memory leak has occurred.

Expected results:
No memory leak

Additional info:

Comment 1 ryo fujita 2008-07-30 01:57:43 UTC
Created attachment 312952 [details]
Patch for mcstrans-0.2.7-1.el5

Comment 2 ryo fujita 2008-07-30 01:59:34 UTC
Created attachment 312954 [details]
patch for mcstrans-0.2.11-1.fc9

Main leak may be fixed, but I guess that more patch is needed.
Please review the patch.

Comment 3 Jeff Bastian 2008-08-08 18:49:37 UTC
I've tested the patch in comment #1 with RHEL 5.2 on an i386 and an x86_64 system and confirmed it plugs the leak on both.

Comment 5 RHEL Program Management 2008-09-04 20:43:25 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 8 Daniel Walsh 2008-09-19 15:31:45 UTC
Upgrading to latest upstream which does not have this problem

Comment 10 Martin Kočí 2008-10-24 07:20:37 UTC
Hi, 
I have tested 32b arches with no problem, but on 64bit valgrind stops with this
warning : 

==22374==
--22374-- WARNING: unhandled syscall: 184
--22374-- You may be able to write your own handler.
--22374-- Read the file README_MISSING_SYSCALL_OR_IOCTL.
==22374==
I'm not able to test it on 64bit arches then, because valgrind is not running. Do you have some idea/clue how to test it alternatively ?

Thank you

Comment 15 errata-xmlrpc 2009-01-20 22:07:49 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-2009-0231.html