Bug 457179 - mcstransd has some memory leaks.
mcstransd has some memory leaks.
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: mcstrans (Show other bugs)
All Linux
high Severity high
: rc
: ---
Assigned To: Daniel Walsh
Depends On:
  Show dependency treegraph
Reported: 2008-07-29 21:57 EDT by ryo fujita
Modified: 2010-10-22 23:16 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-01-20 17:07:49 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Patch for mcstrans-0.2.7-1.el5 (587 bytes, patch)
2008-07-29 21:57 EDT, ryo fujita
no flags Details | Diff
patch for mcstrans-0.2.11-1.fc9 (414 bytes, patch)
2008-07-29 21:59 EDT, ryo fujita
no flags Details | Diff

  None (edit)
Description ryo fujita 2008-07-29 21:57:43 EDT
Description of problem:

Version-Release number of selected component (if applicable):

How reproducible:

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== 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== 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== 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-29 21:57:43 EDT
Created attachment 312952 [details]
Patch for mcstrans-0.2.7-1.el5
Comment 2 ryo fujita 2008-07-29 21:59:34 EDT
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 14:49:37 EDT
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 Product and Program Management 2008-09-04 16:43:25 EDT
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
Comment 8 Daniel Walsh 2008-09-19 11:31:45 EDT
Upgrading to latest upstream which does not have this problem
Comment 10 Martin Kočí 2008-10-24 03:20:37 EDT
I have tested 32b arches with no problem, but on 64bit valgrind stops with this
warning : 

--22374-- WARNING: unhandled syscall: 184
--22374-- You may be able to write your own handler.
--22374-- Read the file README_MISSING_SYSCALL_OR_IOCTL.
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 17:07:49 EST
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.


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