Red Hat Bugzilla – Bug 457179
mcstransd has some memory leaks.
Last modified: 2010-10-22 23:16:42 EDT
Description of problem:
Version-Release number of selected component (if applicable):
Steps to Reproduce:
# 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
# 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.
231 bytes memory leak has occurred.
No memory leak
Created attachment 312952 [details]
Patch for mcstrans-0.2.7-1.el5
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.
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.
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
Upgrading to latest upstream which does not have this problem
I have tested 32b arches with no problem, but on 64bit valgrind stops with this
--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 ?
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.