Hi there,

I'm observing serious memory leaks when using Sofia-sip 1.12.7 . I
have a simple UAS test program with a NUA callback like:

void event_callback(nua_event_t   event,
                    int           status,
                    char const   *phrase,
                    nua_t        *nua,
                    nua_magic_t  *magic,
                    nua_handle_t *nh,
                    nua_hmagic_t *hmagic,
                    sip_t const  *sip,
                    tagi_t        tags[])
{
  switch (event) {
    case nua_i_invite:
      nua_respond(nh, 180, NULL, TAG_END());
      nua_respond(nh, 200, NULL,
                  SIPTAG_CONTENT_TYPE_STR("application/sdp"),
                  SIPTAG_PAYLOAD_STR(g_sdp),
                  TAG_END());
      break;

    case nua_i_bye:
      nua_handle_destroy(nh);
      break;

    default:
      break;
  }
}

When I link this program against sofia-sip 1.12.6 I can keep it
running for ages with 350 caps and the memory usage never goes above
6% in a 2 GB machine. With 1.12.7, 100% memory is used after about 10
minutes.
My test setup uses SIPp to originate the calls. After 26 calls, the
valgrind report gives me this:

==13602== Memcheck, a memory error detector.
==13602== Copyright (C) 2002-2006, and GNU GPL'd, by Julian Seward et al.
==13602== Using LibVEX rev 1658, a library for dynamic binary translation.
==13602== Copyright (C) 2004-2006, and GNU GPL'd, by OpenWorks LLP.
==13602== Using valgrind-3.2.1-Debian, a dynamic binary
instrumentation framework.
==13602== Copyright (C) 2000-2006, and GNU GPL'd, by Julian Seward et al.
==13602== For more details, rerun with: -v
==13602==
==13602==
==13602== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 25 from 1)
==13602== malloc/free: in use at exit: 226,587 bytes in 1,851 blocks.
==13602== malloc/free: 4,567 allocs, 2,716 frees, 643,119 bytes allocated.
==13602== For counts of detected errors, rerun with: -v
==13602== searching for pointers to 1,851 not-freed blocks.
==13602== checked 8,664,364 bytes.
==13602==
==13602== 136 bytes in 1 blocks are possibly lost in loss record 3 of 17
==13602==    at 0x402095F: calloc (vg_replace_malloc.c:279)
==13602==    by 0x400FFA7: (within /lib/ld-2.5.so)
==13602==    by 0x401006B: _dl_allocate_tls (in /lib/ld-2.5.so)
==13602==    by 0x444AA4F: pthread_create@@GLIBC_2.1 (in
/lib/tls/i686/cmov/libpthread-2.5.so)
==13602==    by 0x411A205: su_pthreaded_port_start (su_pthread_port.c:262)
==13602==    by 0x411C1F2: su_epoll_clone_start (su_epoll_port.c:564)
==13602==    by 0x41193A8: su_default_clone_start (su_port.c:78)
==13602==    by 0x4119277: su_clone_start (su_port.c:304)
==13602==    by 0x40C4473: nua_create (nua.c:166)
==13602==    by 0x80488BA: main (teste.c:26)
==13602==
==13602==
==13602== 212,391 (37,752 direct, 174,639 indirect) bytes in 78 blocks
are definitely lost in loss record 15 of 17
==13602==    at 0x402095F: calloc (vg_replace_malloc.c:279)
==13602==    by 0x410E833: su_home_new (su_alloc.c:549)
==13602==    by 0x40866CC: msg_create (msg.c:61)
==13602==    by 0x40A3F71: nta_msg_create_for_transport (nta.c:2746)
==13602==    by 0x4124F2C: tport_msg_alloc (tport.c:2622)
==13602==    by 0x41257D9: tport_recv_iovec (tport.c:3068)
==13602==    by 0x41321BB: tport_recv_dgram (tport_type_udp.c:266)
==13602==    by 0x4130011: tport_recv_event (tport.c:2815)
==13602==    by 0x4130347: tport_base_wakeup (tport.c:2754)
==13602==    by 0x411BCAB: su_epoll_port_wait_events (su_epoll_port.c:506)
==13602==    by 0x4119D01: su_base_port_run (su_base_port.c:336)
==13602==    by 0x4111E28: su_root_run (su_port.h:309)
==13602==
==13602== LEAK SUMMARY:
==13602==    definitely lost: 37,752 bytes in 78 blocks.
==13602==    indirectly lost: 174,639 bytes in 1,690 blocks.
==13602==      possibly lost: 136 bytes in 1 blocks.
==13602==    still reachable: 14,060 bytes in 82 blocks.
==13602==         suppressed: 0 bytes in 0 blocks.
==13602== Reachable blocks (those to which a pointer was found) are not shown.
==13602== To see them, rerun with: --show-reachable=yes

I'm interested in moving to 1.12.7 as soon as possible, but this is a
major show-stopper.
I'll be happy to provide further info. Hope this helps.
Thanks.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel

Reply via email to