You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Colin Patrick McCabe (JIRA)" <ji...@apache.org> on 2014/06/17 06:24:01 UTC

[jira] [Commented] (HADOOP-10705) Fix namenode-rpc-unit warning reported by memory leak check tool(valgrind)

    [ https://issues.apache.org/jira/browse/HADOOP-10705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14033420#comment-14033420 ] 

Colin Patrick McCabe commented on HADOOP-10705:
-----------------------------------------------

You're hitting a bug in Ubuntu.  See https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/119029

Another way of seeing this is by looking at this call stack:
{code}
==12062== 16 bytes in 1 blocks are indirectly lost in loss record 3 of 12
==12062==    at 0x4C2B6CD: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==12062==    by 0x557EB99: __nss_lookup_function (nsswitch.c:456)
==12062==    by 0x6048672: ???
==12062==    by 0x553744C: getpwuid_r@@GLIBC_2.2.5 (getXXbyYY_r.c:256)
==12062==    by 0x42681E: geteuid_string (user.c:67)
==12062==    by 0x425ABD: main (namenode-rpc-unit.c:71)
{code}

If you check the man page, {{getpwuid_r}} does not allocate memory that the user needs to clean up.  So there is no way we could be to blame for this.

Sometimes, system libraries have little leaks in them like this.  Normally, the Linux distro will add "suppression files" to avoid having valgrind spew errors when nothing is actually wrong.  It looks like in this case, your Linux distro doesn't have such a suppression.  So you can either add one manually, or upgrade to a newer distro without this bug.

> Fix namenode-rpc-unit  warning reported by memory leak check tool(valgrind)
> ---------------------------------------------------------------------------
>
>                 Key: HADOOP-10705
>                 URL: https://issues.apache.org/jira/browse/HADOOP-10705
>             Project: Hadoop Common
>          Issue Type: Sub-task
>    Affects Versions: HADOOP-10388
>            Reporter: Wenwu Peng
>         Attachments: vargrind.log
>
>
> Rum valgrind to check memory leak for namenode-rpc.unit.
> There are many warning, need to fix it.
> valgrind --tool=memcheck --leak-check=full --show-reachable=yes ./namenode-rpc-unit 
> ==10462== Memcheck, a memory error detector
> ==10462== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
> ==10462== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
> ==10462== Command: ./namenode-rpc-unit
> ==10462== 
> ==10462== HEAP SUMMARY:
> ==10462==     in use at exit: 428 bytes in 12 blocks
> ==10462==   total heap usage: 91 allocs, 79 frees, 16,056 bytes allocated
> ==10462== 
> ==10462== 16 bytes in 1 blocks are indirectly lost in loss record 1 of 12
> ==10462==    at 0x4C2B6CD: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==10462==    by 0x557EB99: __nss_lookup_function (nsswitch.c:456)
> ==10462==    by 0x604863E: ???
> ==10462==    by 0x553744C: getpwuid_r@@GLIBC_2.2.5 (getXXbyYY_r.c:256)
> ==10462==    by 0x42681E: geteuid_string (user.c:67)
> ==10462==    by 0x425ABD: main (namenode-rpc-unit.c:71)



--
This message was sent by Atlassian JIRA
(v6.2#6252)