Skip to content

Valgrind finds memory leak in ldap_set_option #156

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
encukou opened this issue Jan 10, 2018 · 2 comments
Closed

Valgrind finds memory leak in ldap_set_option #156

encukou opened this issue Jan 10, 2018 · 2 comments

Comments

@encukou
Copy link
Member

encukou commented Jan 10, 2018

Running make valgrind gives me a leak notice:

==22737== 27 bytes in 1 blocks are definitely lost in loss record 71 of 8,573
==22737==    at 0x4C2FB6B: malloc (vg_replace_malloc.c:299)
==22737==    by 0x171CC6EE: PL_strdup (in /usr/lib64/libplc4.so)
==22737==    by 0x15D9AF7B: ??? (in /usr/lib64/libldap_r-2.4.so.2.10.8)
==22737==    by 0x15D9516C: ??? (in /usr/lib64/libldap_r-2.4.so.2.10.8)
==22737==    by 0x15D8B3CC: ldap_set_option (in /usr/lib64/libldap_r-2.4.so.2.10.8)
==22737==    by 0x15B5489C: LDAP_set_option (options.c:189)
==22737==    by 0x15B4DBC5: l_ldap_set_option (LDAPObject.c:1295)
==22737==    by 0x4FC21AE: _PyCFunction_FastCallDict (in /usr/lib64/libpython3.6m.so.1.0)
==22737==    by 0x4FC9279: ??? (in /usr/lib64/libpython3.6m.so.1.0)
==22737==    by 0x4FF2EC9: _PyEval_EvalFrameDefault (in /usr/lib64/libpython3.6m.so.1.0)
==22737==    by 0x4F8BBE9: ??? (in /usr/lib64/libpython3.6m.so.1.0)
==22737==    by 0x4FC933D: ??? (in /usr/lib64/libpython3.6m.so.1.0)
==22737== 

Fedora 27, Python 3.6, python-ldap master (3.0.0b4)

@encukou encukou changed the title Valgrind finds refleak in ldap_set_option Valgrind finds memory leak in ldap_set_option Jan 10, 2018
@tiran
Copy link
Member

tiran commented Jan 10, 2018

It's a known one-time memory leak in libldap's NSS engine. The leak is ignored by a rule. That rule does not match for you because you don't have debug symbols installed. I'll update the rule with a better one.

{
   NSS backend leaks one string during first initialization
   Memcheck:Leak
   match-leak-kinds: definite
   fun:malloc
   fun:PL_strdup
   fun:tlsm_init
   ...
}

@encukou
Copy link
Member Author

encukou commented Jan 10, 2018

Argh. I see.

tiran added a commit to tiran/python-ldap that referenced this issue Jan 10, 2018
libldap's NSS engine has one known memory leak. One block of memory is
leaked one time only. The existing rule only matches when all debug
symbols are installed. The new rule should work without debug symbols.

Closes: python-ldap#156
Signed-off-by: Christian Heimes <cheimes@redhat.com>
encukou pushed a commit that referenced this issue Jan 10, 2018
libldap's NSS engine has one known memory leak. One block of memory is
leaked one time only. The existing rule only matches when all debug
symbols are installed. The new rule should work without debug symbols.

#157
Closes: #156
Signed-off-by: Christian Heimes <cheimes@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants