Reachable memory left behind by simple kadmin client?

Russ Allbery rra at stanford.edu
Thu Dec 22 02:22:34 EST 2011


When I run a very simple kadmin client program, which sets the password
expiration for a principal using a keytab to authenticate, valgrind
reports some 19KB of memory that's "still reachable" at the exit of the
program.  This is despite the fact that my program has no static variables
and frees all of its own memory.  The report says that most of this memory
is either allocated from the profile library or inside GSS-API.

Is this an expected artifact of the way the kadmin client library works
that I should just ignore?

Here's the valgrind results (with 1.10-alpha1):

==23904== HEAP SUMMARY:
==23904==     in use at exit: 19,779 bytes in 456 blocks
==23904==   total heap usage: 2,510 allocs, 2,054 frees, 175,787 bytes allocated
==23904== 
==23904== 7 bytes in 1 blocks are still reachable in loss record 1 of 21
==23904==    at 0x4025018: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==23904==    by 0x41989DF: strdup (strdup.c:43)
==23904==    by 0x40D3E51: profile_create_node (prof_tree.c:98)
==23904==    by 0x40D68BF: profile_parse_file (prof_parse.c:441)
==23904==    by 0x40D4F6E: profile_update_file_data_locked (prof_file.c:369)
==23904==    by 0x40D50AA: profile_update_file_data (prof_file.c:389)
==23904==    by 0x40D588E: profile_open_file (prof_file.c:288)
==23904==    by 0x40D8C62: profile_init_flags (prof_init.c:198)
==23904==    by 0x40CD994: os_init_paths (init_os_ctx.c:328)
==23904==    by 0x40A9514: krb5_init_context_profile (init_ctx.c:165)
==23904== 
==23904== 8 bytes in 1 blocks are still reachable in loss record 2 of 21
==23904==    at 0x4025018: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==23904==    by 0x404271A: initialize_ovk_error_table_r (kadm_err.c:102)
==23904==    by 0x80494C4: main (in /home/eagle/dvl/pam-krb5/test)
==23904== 
==23904== 8 bytes in 1 blocks are still reachable in loss record 3 of 21
==23904==    at 0x4025018: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==23904==    by 0x40427CA: initialize_ovku_error_table_r (chpass_util_strings.c:60)
==23904==    by 0x80494C4: main (in /home/eagle/dvl/pam-krb5/test)
==23904== 
==23904== 12 bytes in 1 blocks are still reachable in loss record 4 of 21
==23904==    at 0x4025018: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==23904==    by 0x40D55C1: profile_open_file (prof_file.c:210)
==23904==    by 0x40D8C62: profile_init_flags (prof_init.c:198)
==23904==    by 0x40CD994: os_init_paths (init_os_ctx.c:328)
==23904==    by 0x40A9514: krb5_init_context_profile (init_ctx.c:165)
==23904==    by 0x40A9905: krb5_init_context (init_ctx.c:91)
==23904== 
==23904== 20 bytes in 1 blocks are still reachable in loss record 5 of 21
==23904==    at 0x4025018: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==23904==    by 0x40D8BE9: profile_init_flags (prof_init.c:182)
==23904==    by 0x40CD994: os_init_paths (init_os_ctx.c:328)
==23904==    by 0x40A9514: krb5_init_context_profile (init_ctx.c:165)
==23904==    by 0x40A9905: krb5_init_context (init_ctx.c:91)
==23904== 
==23904== 24 bytes in 1 blocks are still reachable in loss record 6 of 21
==23904==    at 0x4025018: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==23904==    by 0x430828F: krb5int_setspecific (threads.c:293)
==23904==    by 0x42B9B99: kg_set_ccache_name (gssapi_krb5.c:301)
==23904==    by 0x42C8DDC: gss_krb5int_ccache_name (set_ccache.c:77)
==23904==    by 0x42B9505: krb5_gssspi_mech_invoke (gssapi_krb5.c:618)
==23904== 
==23904== 33 bytes in 1 blocks are still reachable in loss record 7 of 21
==23904==    at 0x4025018: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==23904==    by 0x41989DF: strdup (strdup.c:43)
==23904==    by 0x42B9B29: kg_get_ccache_name (gssapi_krb5.c:260)
==23904==    by 0x42C8DB0: gss_krb5int_ccache_name (set_ccache.c:66)
==23904==    by 0x42B9505: krb5_gssspi_mech_invoke (gssapi_krb5.c:618)
==23904== 
==23904== 33 bytes in 1 blocks are still reachable in loss record 8 of 21
==23904==    at 0x4025018: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==23904==    by 0x41989DF: strdup (strdup.c:43)
==23904==    by 0x42B9B75: kg_set_ccache_name (gssapi_krb5.c:290)
==23904==    by 0x42C8DDC: gss_krb5int_ccache_name (set_ccache.c:77)
==23904==    by 0x42B9505: krb5_gssspi_mech_invoke (gssapi_krb5.c:618)
==23904== 
==23904== 36 bytes in 1 blocks are still reachable in loss record 9 of 21
==23904==    at 0x4025018: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==23904==    by 0x40D3E2E: profile_create_node (prof_tree.c:92)
==23904==    by 0x40D68BF: profile_parse_file (prof_parse.c:441)
==23904==    by 0x40D4F6E: profile_update_file_data_locked (prof_file.c:369)
==23904==    by 0x40D50AA: profile_update_file_data (prof_file.c:389)
==23904==    by 0x40D588E: profile_open_file (prof_file.c:288)
==23904==    by 0x40D8C62: profile_init_flags (prof_init.c:198)
==23904==    by 0x40CD994: os_init_paths (init_os_ctx.c:328)
==23904==    by 0x40A9514: krb5_init_context_profile (init_ctx.c:165)
==23904== 
==23904== 37 bytes in 1 blocks are still reachable in loss record 10 of 21
==23904==    at 0x4025018: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==23904==    by 0x41989DF: strdup (strdup.c:43)
==23904==    by 0x40D778B: profile_get_string (prof_get.c:275)
==23904==    by 0x40A97E4: krb5_init_context_profile (init_ctx.c:231)
==23904==    by 0x40A9905: krb5_init_context (init_ctx.c:91)
==23904== 
==23904== 52 bytes in 5 blocks are still reachable in loss record 11 of 21
==23904==    at 0x4025018: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==23904==    by 0x41989DF: strdup (strdup.c:43)
==23904==    by 0x40D3E51: profile_create_node (prof_tree.c:98)
==23904==    by 0x40D3FDD: profile_add_node (prof_tree.c:172)
==23904==    by 0x40D681E: parse_file (prof_parse.c:106)
==23904==    by 0x40D68E3: profile_parse_file (prof_parse.c:445)
==23904==    by 0x40D4F6E: profile_update_file_data_locked (prof_file.c:369)
==23904==    by 0x40D50AA: profile_update_file_data (prof_file.c:389)
==23904==    by 0x40D588E: profile_open_file (prof_file.c:288)
==23904==    by 0x40D8C62: profile_init_flags (prof_init.c:198)
==23904==    by 0x40CD994: os_init_paths (init_os_ctx.c:328)
==23904==    by 0x40A9514: krb5_init_context_profile (init_ctx.c:165)
==23904== 
==23904== 64 bytes in 1 blocks are still reachable in loss record 12 of 21
==23904==    at 0x4023796: calloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==23904==    by 0x42844BB: gssrpc_authnone_create (auth_none.c:84)
==23904==    by 0x428A130: gssrpc_clnttcp_create (clnt_tcp.c:233)
==23904==    by 0x404C2CF: init_any.isra.2 (client_init.c:297)
==23904==    by 0x8049697: kerberos_expire_password (kadmin.c:99)
==23904==    by 0x80494C4: main (in /home/eagle/dvl/pam-krb5/test)
==23904== 
==23904== 104 bytes in 1 blocks are still reachable in loss record 13 of 21
==23904==    at 0x4025018: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==23904==    by 0x40D4DF0: profile_make_prf_data (prof_file.c:180)
==23904==    by 0x40D584B: profile_open_file (prof_file.c:272)
==23904==    by 0x40D8C62: profile_init_flags (prof_init.c:198)
==23904==    by 0x40CD994: os_init_paths (init_os_ctx.c:328)
==23904==    by 0x40A9514: krb5_init_context_profile (init_ctx.c:165)
==23904== 
==23904== 180 bytes in 5 blocks are still reachable in loss record 14 of 21
==23904==    at 0x4025018: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==23904==    by 0x40D3E2E: profile_create_node (prof_tree.c:92)
==23904==    by 0x40D3FDD: profile_add_node (prof_tree.c:172)
==23904==    by 0x40D681E: parse_file (prof_parse.c:106)
==23904==    by 0x40D68E3: profile_parse_file (prof_parse.c:445)
==23904==    by 0x40D4F6E: profile_update_file_data_locked (prof_file.c:369)
==23904==    by 0x40D50AA: profile_update_file_data (prof_file.c:389)
==23904==    by 0x40D588E: profile_open_file (prof_file.c:288)
==23904==    by 0x40D8C62: profile_init_flags (prof_init.c:198)
==23904==    by 0x40CD994: os_init_paths (init_os_ctx.c:328)
==23904==    by 0x40A9514: krb5_init_context_profile (init_ctx.c:165)
==23904== 
==23904== 342 bytes in 24 blocks are still reachable in loss record 15 of 21
==23904==    at 0x4025018: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==23904==    by 0x41989DF: strdup (strdup.c:43)
==23904==    by 0x40D3E51: profile_create_node (prof_tree.c:98)
==23904==    by 0x40D3FDD: profile_add_node (prof_tree.c:172)
==23904==    by 0x40D65A0: parse_file (prof_parse.c:185)
==23904==    by 0x40D68E3: profile_parse_file (prof_parse.c:445)
==23904==    by 0x40D4F6E: profile_update_file_data_locked (prof_file.c:369)
==23904==    by 0x40D50AA: profile_update_file_data (prof_file.c:389)
==23904==    by 0x40D588E: profile_open_file (prof_file.c:288)
==23904==    by 0x40D8C62: profile_init_flags (prof_init.c:198)
==23904==    by 0x40CD994: os_init_paths (init_os_ctx.c:328)
==23904==    by 0x40A9514: krb5_init_context_profile (init_ctx.c:165)
==23904== 
==23904== 864 bytes in 24 blocks are still reachable in loss record 16 of 21
==23904==    at 0x4025018: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==23904==    by 0x40D3E2E: profile_create_node (prof_tree.c:92)
==23904==    by 0x40D3FDD: profile_add_node (prof_tree.c:172)
==23904==    by 0x40D65A0: parse_file (prof_parse.c:185)
==23904==    by 0x40D68E3: profile_parse_file (prof_parse.c:445)
==23904==    by 0x40D4F6E: profile_update_file_data_locked (prof_file.c:369)
==23904==    by 0x40D50AA: profile_update_file_data (prof_file.c:389)
==23904==    by 0x40D588E: profile_open_file (prof_file.c:288)
==23904==    by 0x40D8C62: profile_init_flags (prof_init.c:198)
==23904==    by 0x40CD994: os_init_paths (init_os_ctx.c:328)
==23904==    by 0x40A9514: krb5_init_context_profile (init_ctx.c:165)
==23904== 
==23904== 1,216 bytes in 1 blocks are still reachable in loss record 17 of 21
==23904==    at 0x4023796: calloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==23904==    by 0x40A94E6: krb5_init_context_profile (init_ctx.c:158)
==23904==    by 0x40A9905: krb5_init_context (init_ctx.c:91)
==23904== 
==23904== 1,459 bytes in 128 blocks are still reachable in loss record 18 of 21
==23904==    at 0x4025018: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==23904==    by 0x41989DF: strdup (strdup.c:43)
==23904==    by 0x40D3E51: profile_create_node (prof_tree.c:98)
==23904==    by 0x40D3FDD: profile_add_node (prof_tree.c:172)
==23904==    by 0x40D686A: parse_file (prof_parse.c:197)
==23904==    by 0x40D68E3: profile_parse_file (prof_parse.c:445)
==23904==    by 0x40D4F6E: profile_update_file_data_locked (prof_file.c:369)
==23904==    by 0x40D50AA: profile_update_file_data (prof_file.c:389)
==23904==    by 0x40D588E: profile_open_file (prof_file.c:288)
==23904==    by 0x40D8C62: profile_init_flags (prof_init.c:198)
==23904==    by 0x40CD994: os_init_paths (init_os_ctx.c:328)
==23904==    by 0x40A9514: krb5_init_context_profile (init_ctx.c:165)
==23904== 
==23904== 2,480 bytes in 128 blocks are still reachable in loss record 19 of 21
==23904==    at 0x4025018: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==23904==    by 0x41989DF: strdup (strdup.c:43)
==23904==    by 0x40D3E6C: profile_create_node (prof_tree.c:104)
==23904==    by 0x40D3FDD: profile_add_node (prof_tree.c:172)
==23904==    by 0x40D686A: parse_file (prof_parse.c:197)
==23904==    by 0x40D68E3: profile_parse_file (prof_parse.c:445)
==23904==    by 0x40D4F6E: profile_update_file_data_locked (prof_file.c:369)
==23904==    by 0x40D50AA: profile_update_file_data (prof_file.c:389)
==23904==    by 0x40D588E: profile_open_file (prof_file.c:288)
==23904==    by 0x40D8C62: profile_init_flags (prof_init.c:198)
==23904==    by 0x40CD994: os_init_paths (init_os_ctx.c:328)
==23904==    by 0x40A9514: krb5_init_context_profile (init_ctx.c:165)
==23904== 
==23904== 4,608 bytes in 128 blocks are still reachable in loss record 20 of 21
==23904==    at 0x4025018: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==23904==    by 0x40D3E2E: profile_create_node (prof_tree.c:92)
==23904==    by 0x40D3FDD: profile_add_node (prof_tree.c:172)
==23904==    by 0x40D686A: parse_file (prof_parse.c:197)
==23904==    by 0x40D68E3: profile_parse_file (prof_parse.c:445)
==23904==    by 0x40D4F6E: profile_update_file_data_locked (prof_file.c:369)
==23904==    by 0x40D50AA: profile_update_file_data (prof_file.c:389)
==23904==    by 0x40D588E: profile_open_file (prof_file.c:288)
==23904==    by 0x40D8C62: profile_init_flags (prof_init.c:198)
==23904==    by 0x40CD994: os_init_paths (init_os_ctx.c:328)
==23904==    by 0x40A9514: krb5_init_context_profile (init_ctx.c:165)
==23904== 
==23904== 8,192 bytes in 1 blocks are still reachable in loss record 21 of 21
==23904==    at 0x4025018: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==23904==    by 0x4288BEB: get_buf (clnt_perror.c:69)
==23904==    by 0x4288C5C: gssrpc_clnt_sperror (clnt_perror.c:82)
==23904==    by 0x42860FC: authgss_refresh (auth_gss.c:455)
==23904==    by 0x4286428: gssrpc_authgss_create (auth_gss.c:209)
==23904== 
==23904== LEAK SUMMARY:
==23904==    definitely lost: 0 bytes in 0 blocks
==23904==    indirectly lost: 0 bytes in 0 blocks
==23904==      possibly lost: 0 bytes in 0 blocks
==23904==    still reachable: 19,779 bytes in 456 blocks
==23904==         suppressed: 0 bytes in 0 blocks

-- 
Russ Allbery (rra at stanford.edu)             <http://www.eyrie.org/~eagle/>


More information about the Kerberos mailing list