#2342 sss_sifp: investigate memory leak in tests
Closed: Fixed None Opened 9 years ago by pbrezina.

=24809== 664 (184 direct, 480 indirect) bytes in 1 blocks are definitely lost in loss record 16 of 16
==24809==    at 0x4A0881C: malloc (vg_replace_malloc.c:270)
==24809==    by 0x3386A17BB5: ??? (in /usr/lib64/libdbus-1.so.3.5.6)
==24809==    by 0x3386A189D2: dbus_message_new_method_call (in /usr/lib64/libdbus-1.so.3.5.6)
==24809==    by 0x40B7D8: sss_sifp_create_message (sss_sifp_dbus.c:63)
==24809==    by 0x40BD75: sss_sifp_create_prop_msg (sss_sifp.c:44)
==24809==    by 0x40C0B6: sss_sifp_fetch_attr (sss_sifp.c:160)
==24809==    by 0x406065: test_sss_sifp_fetch_attr (test_sss_sifp.c:1336)
==24809==    by 0x4C30767: _run_test (cmocka.c:1723)
==24809==    by 0x4C30BF8: _run_tests (cmocka.c:1839)
==24809==    by 0x40837C: main (test_sss_sifp.c:1928)

The leak comes from a newly created dbus message, however the message is correctly unreferenced through dbus_message_unref. It may be only test related, since the message is never send there.


Fields changed

milestone: NEEDS_TRIAGE => SSSD 1.12.0
rhbz: => 0

Fields changed

owner: somebody => pbrezina
status: new => assigned

I can confirm that this is only test related issue. The memory leak occurs always in the first test from the test group that creates and sends a message. The D-Bus store the message in internal cache and then reuses it over and over again. It is normally freed under some conditions, but those are not met in the tests since we don't really communicate with any bus there.

Unfortunately, there is no way how to disable the message cache besides recompile D-Bus with proper configure flag.

I wrote a simple program to test the function under real conditions a no memory leak occurred.

resolution: => cantfix
status: assigned => closed

Metadata Update from @pbrezina:
- Issue assigned to pbrezina
- Issue set to the milestone: SSSD 1.12.0

7 years ago

SSSD is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in SSSD's github repository.

This issue has been cloned to Github and is available here:
- https://github.com/SSSD/sssd/issues/3384

If you want to receive further updates on the issue, please navigate to the github issue
and click on subscribe button.

Thank you for understanding. We apologize for all inconvenience.

Login to comment on this ticket.

Metadata