#47421 memleaks in set_krb5_creds
Closed: Fixed None Opened 6 years ago by rmeggins.

Steps:
1) Setup 2 way MMR using SASL/GSSAPI/kerberos for the replication transport/bind.
2) run 1 of the servers using valgrind
3) do a bunch of add operations against both servers

==6228== 104 bytes in 6 blocks are definitely lost in loss record 1,014 of 1,560
==6228==    at 0x4A069EE: malloc (vg_replace_malloc.c:270)
==6228==    by 0x32CC24B273: krb5_ktfileint_internal_read_entry (kt_file.c:1375)
==6228==    by 0x32CC24CE34: krb5_ktfile_get_next (kt_file.c:1414)
==6228==    by 0x32CC25ECF0: krb5_init_creds_set_keytab (gic_keytab.c:101)
==6228==    by 0x32CC25F09D: get_init_creds_keytab (gic_keytab.c:242)
==6228==    by 0x32CC25F1B2: krb5_get_init_creds_keytab (gic_keytab.c:284)
==6228==    by 0x4C823B2: set_krb5_creds (ldaputil.c:1952)
==6228==    by 0x4C80C8C: ldap_sasl_set_interact_vals (ldaputil.c:1354)
==6228==    by 0x4C81004: slapd_ldap_sasl_interactive_bind (ldaputil.c:1470)
==6228==    by 0x4C8078C: slapi_ldap_bind (ldaputil.c:1159)
==6228==    by 0x9DBA475: bind_and_check_pwp (repl5_connection.c:1784)
==6228==    by 0x9DB9025: conn_connect (repl5_connection.c:1150)
==6228==    by 0x9DC3FD7: acquire_replica (repl5_protocol_util.c:169)
==6228==    by 0x9DBBA51: repl5_inc_run (repl5_inc_protocol.c:791)
==6228==    by 0x9DC3546: prot_thread_main (repl5_protocol.c:319)
==6228==    by 0x3DABA29B52: _pt_root (ptthread.c:156)
==6228==    by 0x3D3CE07850: start_thread (pthread_create.c:301)
==6228==    by 0x3D3C2E890C: clone (clone.S:115)

not sure what this is - may be due to below

==6228== 126 bytes in 3 blocks are definitely lost in loss record 1,052 of 1,560
==6228==    at 0x4A069EE: malloc (vg_replace_malloc.c:270)
==6228==    by 0x32CC2791EA: k5_unparse_name (unparse.c:201)
==6228==    by 0x4C81D77: set_krb5_creds (ldaputil.c:1821)
==6228==    by 0x4C80C8C: ldap_sasl_set_interact_vals (ldaputil.c:1354)
==6228==    by 0x4C81004: slapd_ldap_sasl_interactive_bind (ldaputil.c:1470)
==6228==    by 0x4C8078C: slapi_ldap_bind (ldaputil.c:1159)
==6228==    by 0x9DBA475: bind_and_check_pwp (repl5_connection.c:1784)
==6228==    by 0x9DB9025: conn_connect (repl5_connection.c:1150)
==6228==    by 0x9DC3FD7: acquire_replica (repl5_protocol_util.c:169)
==6228==    by 0x9DBBA51: repl5_inc_run (repl5_inc_protocol.c:791)
==6228==    by 0x9DC3546: prot_thread_main (repl5_protocol.c:319)
==6228==    by 0x3DABA29B52: _pt_root (ptthread.c:156)
==6228==    by 0x3D3CE07850: start_thread (pthread_create.c:301)
==6228==    by 0x3D3C2E890C: clone (clone.S:115)
==6228==

We call krb5_unparse_name() on line 1904 which will overwrite princ_name if it is already set on line 1821 - must free princ_name first.

==6228== 336 (120 direct, 216 indirect) bytes in 3 blocks are definitely lost in loss record 1,263 of 1,560
==6228==    at 0x4A069EE: malloc (vg_replace_malloc.c:270)
==6228==    by 0x32CC255382: krb5_copy_principal (copy_princ.c:38)
==6228==    by 0x4C81C83: set_krb5_creds (ldaputil.c:1804)
==6228==    by 0x4C80C8C: ldap_sasl_set_interact_vals (ldaputil.c:1354)
==6228==    by 0x4C81004: slapd_ldap_sasl_interactive_bind (ldaputil.c:1470)
==6228==    by 0x4C8078C: slapi_ldap_bind (ldaputil.c:1159)
==6228==    by 0x9DBA475: bind_and_check_pwp (repl5_connection.c:1784)
==6228==    by 0x9DB9025: conn_connect (repl5_connection.c:1150)
==6228==    by 0x9DC3FD7: acquire_replica (repl5_protocol_util.c:169)
==6228==    by 0x9DBBA51: repl5_inc_run (repl5_inc_protocol.c:791)
==6228==    by 0x9DC3546: prot_thread_main (repl5_protocol.c:319)
==6228==    by 0x3DABA29B52: _pt_root (ptthread.c:156)
==6228==    by 0x3D3CE07850: start_thread (pthread_create.c:301)
==6228==    by 0x3D3C2E890C: clone (clone.S:115)


==6228== 684 (240 direct, 444 indirect) bytes in 6 blocks are definitely lost in loss record 1,365 of 1,560
==6228==    at 0x4A069EE: malloc (vg_replace_malloc.c:270)
==6228==    by 0x32CC24AEA3: krb5_ktfileint_internal_read_entry (kt_file.c:1253)
==6228==    by 0x32CC24CE34: krb5_ktfile_get_next (kt_file.c:1414)
==6228==    by 0x32CC25ECF0: krb5_init_creds_set_keytab (gic_keytab.c:101)
==6228==    by 0x32CC25F09D: get_init_creds_keytab (gic_keytab.c:242)
==6228==    by 0x32CC25F1B2: krb5_get_init_creds_keytab (gic_keytab.c:284)
==6228==    by 0x4C823B2: set_krb5_creds (ldaputil.c:1952)
==6228==    by 0x4C80C8C: ldap_sasl_set_interact_vals (ldaputil.c:1354)
==6228==    by 0x4C81004: slapd_ldap_sasl_interactive_bind (ldaputil.c:1470)
==6228==    by 0x4C8078C: slapi_ldap_bind (ldaputil.c:1159)
==6228==    by 0x9DBA475: bind_and_check_pwp (repl5_connection.c:1784)
==6228==    by 0x9DB9025: conn_connect (repl5_connection.c:1150)
==6228==    by 0x9DC3FD7: acquire_replica (repl5_protocol_util.c:169)
==6228==    by 0x9DBBA51: repl5_inc_run (repl5_inc_protocol.c:791)
==6228==    by 0x9DC3546: prot_thread_main (repl5_protocol.c:319)
==6228==    by 0x3DABA29B52: _pt_root (ptthread.c:156)
==6228==    by 0x3D3CE07850: start_thread (pthread_create.c:301)
==6228==    by 0x3D3C2E890C: clone (clone.S:115)

git merge ticket47421
Updating b4cdebb..db124a2
Fast-forward
ldap/servers/slapd/ldaputil.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

git push origin master
b4cdebb..db124a2 master -> master

commit db124a2

389-ds-base-1.3.1:

git push origin 389-ds-base-1.3.1
f6ef7dc..bd2a028 389-ds-base-1.3.1 -> 389-ds-base-1.3.1

1.3.0:
1cca5bf..3f75400 389-ds-base-1.3.0 -> 389-ds-base-1.3.0

1.2.11:
0ac4187..c1dcfc6 389-ds-base-1.2.11 -> 389-ds-base-1.2.11

Metadata Update from @nkinder:
- Issue assigned to mreynolds
- Issue set to the milestone: 1.2.11.22

2 years ago

Login to comment on this ticket.

Metadata