kadmind memory leaks in recent MIT krb code

Mark Phalan Mark.Phalan at Sun.COM
Thu Jun 26 12:21:20 EDT 2008


On 25 Jun 2008, at 23:12, Will Fiveash wrote:

> While testing my mkey keytab changes I discovered that kadmind was
> leaking memory.  My branch is based on revision 20367 of the trunk.
>
> The leaks fall into one of the following:
>
>            ADDR          BUFADDR        TIMESTAMP           THREAD
>                            CACHE          LASTLOG         CONTENTS
>         81b2da0          81b09c8    8e11e41922dd9                1
>                          8178a90          80c35dc                0
>                 libumem.so.1`umem_cache_alloc_debug+0x14f
>                 libumem.so.1`umem_cache_alloc+0x144
>                 libumem.so.1`umem_alloc+0xc5
>                 libumem.so.1`malloc+0x27
>                 libc.so.1`strdup+0x28
>                 libkrb5support.so.0.1`krb5int_get_error+0x190
>                 libkrb5.so.3.3`krb5_get_error_message+0x28
>                 get_policy_2_svc+0x1b4
>                 kadm_1+0x615
>                 libgssrpc.so.4.0`gssrpc_svc_getreqset+0x2a0
>                 kadm_svc_run+0xe5
>                 main+0xd27
>                 _start+0x80
>
> It looks like there are a number of places calling
> krb5_get_error_message() that are not freeing the returned error  
> string.

Yup, I found (and fixed) a whole bunch of these when doing the 1.6.3  
resync with our code. I'll turn it into a patch and file a bug.

>
>
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
>
>            ADDR          BUFADDR        TIMESTAMP           THREAD
>                            CACHE          LASTLOG         CONTENTS
>         818e718          818b640    8e2eb8f39eb39                1
>                          8178390          80cbed8                0
>                 libumem.so.1`umem_cache_alloc_debug+0x14f
>                 libumem.so.1`umem_cache_alloc+0x144
>                 libumem.so.1`umem_alloc+0xc5
>                 libumem.so.1`malloc+0x27
>                 libgssapi_krb5.so.2.2`gss_add_cred+0x23b
>                 libgssapi_krb5.so.2.2`gss_acquire_cred+0x11e
>                 libgssrpc.so.4.0`gssrpc__svcauth_gss+0x47f
>                 libgssrpc.so.4.0`gssrpc__authenticate+0x8d
>                 libgssrpc.so.4.0`gssrpc_svc_getreqset+0x132
>                 kadm_svc_run+0xe5
>                 main+0xd27
>                 _start+0x80
>
> Not sure what the exact cause is as malloc() is called in several  
> places
> in gss_add_cred().

I'm not sure if I saw this one.

-Mark



More information about the krbdev mailing list