[libnice] Memory leaks

Miguel París Díaz mparisdiaz at gmail.com
Tue Apr 21 10:15:49 PDT 2015


Hello again,
I have run valgrind again with debug symbol and this is the output for
libnice *v0.1.10*:

*nice_agent_gather_candidates*
==12303== 688 (80 direct, 608 indirect) bytes in 2 blocks are definitely
lost in loss record 8,233 of 8,519
==12303==    at 0x517247A: g_type_create_instance (in
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.4200.1)
==12303==    by 0x51571EC: g_object_new_internal (in
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.4200.1)
==12303==    by 0x51590B3: g_object_new_valist (in
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.4200.1)
==12303==    by 0x79515F8: g_initable_new_valist (in
/usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.4200.1)
==12303==    by 0x79516EB: g_initable_new (in
/usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.4200.1)
==12303==    by 0x7968BA7: g_socket_new (in
/usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.4200.1)
==12303==    by 0xA6B3578: nice_tcp_passive_socket_new (tcp-passive.c:96)
==12303==    by 0xA6A8E1E: discovery_add_local_host_candidate
(discovery.c:563)
==12303==    by 0xA69F7C2: nice_agent_gather_candidates (agent.c:2737)
==12303==    by 0xA28249F: kms_webrtc_endpoint_gather_candidates
(kmswebrtcendpoint.c:764)
==12303==    by 0xA2843DC: __kms_webrtc_marshal_BOOLEAN__VOID
(kms-webrtc-marshal.c:83)
==12303==    by 0x51521C7: g_closure_invoke (in
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.4200.1)
==12303==    by 0x516318A: signal_emit_unlocked_R (in
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.4200.1)
==12303==    by 0x516AD67: g_signal_emit_valist (in
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.4200.1)
==12303==    by 0x516B881: g_signal_emit_by_name (in
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.4200.1)
==12303==    by 0x402D9E: test_audio_sendrecv.constprop.4
(webrtcendpoint.c:700)
==12303==    by 0x4030B6: test_pcmu_sendrecv (webrtcendpoint.c:1253)
==12303==    by 0x56ABE79: srunner_run_all (in
/usr/lib/x86_64-linux-gnu/libgstcheck-1.0.so.0.404.0)
==12303==    by 0x56A5BFD: gst_check_run_suite (in
/usr/lib/x86_64-linux-gnu/libgstcheck-1.0.so.0.404.0)
==12303==    by 0x401E63: main (webrtcendpoint.c:1305)

==12303== 528 (208 direct, 320 indirect) bytes in 2 blocks are definitely
lost in loss record 8,131 of 8,519
==12303==    at 0x4C2AB80: malloc (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==12303==    by 0x53E13D0: g_malloc (in
/lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==12303==    by 0x53F70ED: g_slice_alloc (in
/lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==12303==    by 0x53F762D: g_slice_alloc0 (in
/lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==12303==    by 0xA6B26F1: nice_tcp_active_socket_new (tcp-active.c:106)
==12303==    by 0xA6A8DFE: discovery_add_local_host_candidate
(discovery.c:561)
==12303==    by 0xA69F7C2: nice_agent_gather_candidates (agent.c:2737)
==12303==    by 0xA28249F: kms_webrtc_endpoint_gather_candidates
(kmswebrtcendpoint.c:764)
==12303==    by 0xA2843DC: __kms_webrtc_marshal_BOOLEAN__VOID
(kms-webrtc-marshal.c:83)
==12303==    by 0x51521C7: g_closure_invoke (in
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.4200.1)
==12303==    by 0x516318A: signal_emit_unlocked_R (in
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.4200.1)
==12303==    by 0x516AD67: g_signal_emit_valist (in
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.4200.1)
==12303==    by 0x516B881: g_signal_emit_by_name (in
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.4200.1)
==12303==    by 0x402D9E: test_audio_sendrecv.constprop.4
(webrtcendpoint.c:700)
==12303==    by 0x4030B6: test_pcmu_sendrecv (webrtcendpoint.c:1253)
==12303==    by 0x56ABE79: srunner_run_all (in
/usr/lib/x86_64-linux-gnu/libgstcheck-1.0.so.0.404.0)
==12303==    by 0x56A5BFD: gst_check_run_suite (in
/usr/lib/x86_64-linux-gnu/libgstcheck-1.0.so.0.404.0)
==12303==    by 0x401E63: main (webrtcendpoint.c:1305)


*nice_agent_add_stream*
==12303== 144 bytes in 2 blocks are possibly lost in loss record 7,624 of
8,519
==12303==    at 0x4C2CC70: calloc (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==12303==    by 0x53E1428: g_malloc0 (in
/lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==12303==    by 0x5151104: g_closure_new_simple (in
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.4200.1)
==12303==    by 0x51525A1: g_cclosure_new (in
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.4200.1)
==12303==    by 0x516909E: g_signal_connect_data (in
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.4200.1)
==12303==    by 0x792F40B: g_cancellable_source_new (in
/usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.4200.1)
==12303==    by 0xA697CB1: component_new (component.c:150)
==12303==    by 0xA6A1EDF: stream_new (stream.c:68)
==12303==    by 0xA69B49F: nice_agent_add_stream (agent.c:2361)
==12303==    by 0xA27F6B5: kms_webrtc_base_connection_configure
(kmswebrtcbaseconnection.c:35)
==12303==    by 0xA2811A4: kms_webrtc_bundle_connection_new
(kmswebrtcbundleconnection.c:211)
==12303==    by 0xA282B95: kms_webrtc_endpoint_create_bundle_connection
(kmswebrtcendpoint.c:172)
==12303==    by 0x58C22F0: kms_base_rtp_endpoint_configure_media
(kmsbasertpendpoint.c:487)
==12303==    by 0xA282D28: kms_webrtc_endpoint_configure_media
(kmswebrtcendpoint.c:541)
==12303==    by 0x6E558FA: create_media_answer (kmssdpagent.c:487)
==12303==    by 0x58CE6B2: sdp_utils_for_each_media (sdp_utils.c:811)
==12303==    by 0x6E5562F: kms_sdp_agent_create_answer_impl
(kmssdpagent.c:524)
==12303==    by 0x58C542D: kms_base_sdp_endpoint_process_offer
(kmsbasesdpendpoint.c:377)
==12303==    by 0x58CB614: __kms_core_marshal_BOXED__BOXED
(kms-core-marshal.c:121)
==12303==    by 0x51521C7: g_closure_invoke (in
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.4200.1)


I cannot reproduce the memory leak that I reported some days ago about
*g_source_set_dummy_callback*. But I have searched for it into libnice
code, and I have found this entries:
agent/outputstream.c:607:    g_source_set_dummy_callback
(cancellable_source);
agent/outputstream.c:635:    g_source_set_dummy_callback
(cancellable_source);
agent/inputstream.c:475:    g_source_set_dummy_callback
(cancellable_source);
agent/component.c:151:  g_source_set_dummy_callback
(component->stop_cancellable_source);
agent/component.c:1032:    g_source_set_dummy_callback
(child_socket_source->source);
agent/component.c:1177:    g_source_set_dummy_callback (cancellable_source);
tests/test-new-dribble.c:732:  g_source_set_dummy_callback (src);


I hope this can help you ;).


2015-04-15 13:08 GMT+02:00 Miguel París Díaz <mparisdiaz at gmail.com>:

> Yes, you are right, sorry for not sending a complete report.
> I will do it when I can and send the report again ;).
>
> 2015-04-13 16:32 GMT+02:00 Philip Withnall <philip at tecnocode.co.uk>:
>
>> Hi,
>>
>> On Mon, 2015-04-13 at 13:10 +0200, Miguel París Díaz wrote:
>> > Hello,
>> >
>> > I have tested my system with valgrind and I have seen some memory
>> > leaks into libnice v0.1.10.
>> > Valgind does not detect any memory leak running the same tests with
>> > v0.1.7.
>> >
>> > I hope this can help you to fix them ;).
>>
>> Not really, without the necessary debug symbols (replacing the ‘???’
>> entries in the stack traces below).
>>
>> Can you please install the debug info package for your distribution for
>> libnice, or recompile it with debug symbols enabled; then produce a new
>> set of leak traces with valgrind?
>>
>> Thanks,
>> Philip
>>
>>
>
>
> --
> Miguel París Díaz
> ------------------------------------------------------------------------
> Computer/Software engineer.
> Researcher and architect in http://www.kurento.org
> http://twitter.com/mparisdiaz
> ------------------------------------------------------------------------
>



-- 
Miguel París Díaz
------------------------------------------------------------------------
Computer/Software engineer.
Researcher and architect in http://www.kurento.org
http://twitter.com/mparisdiaz
------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/nice/attachments/20150421/f7cb943e/attachment.html>


More information about the nice mailing list