Re: [Sofia-sip-devel] Memory Leaks in 1.12.7?

2007-12-07 Thread mikhail.zabaluev
Hi, 

-Original Message-
From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On 
Behalf Of ext Jerry Richards
Sent: Thursday, December 06, 2007 5:04 PM
To: sofia-sip-devel@lists.sourceforge.net
Subject: [Sofia-sip-devel] Memory Leaks in 1.12.7?

Hello All,

If I run my application overnight, it apparently exhausts all 
memory.  I am
running version 1.12.7.

Pekka has committed a fix to the master darcs repo since.

Get the source from darcs as per tag 'rel-sofia-sip-1_12_7',
then pull the patch moved messsage passing into nua_stack.

Hope this helps,
  Mikhail

-
SF.Net email is sponsored by: 
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


Re: [Sofia-sip-devel] Memory leaks in 1.12.7

2007-10-25 Thread Pekka Pessi
2007/10/24, Michael Jerris [EMAIL PROTECTED]:
 we have this issue already narrowed down to the patch that caused it:

  Mon Oct  8 07:54:24 EDT 2007   [EMAIL PROTECTED]
* nua.c: nua event callback does not use nua_t object after
 nua_destroy()
  call. sf.net bug #1803686

 and Pekka said he was going to look into it.  I'll let him respond with any
 more details from there, we just reverted that patch from our snapshot and
 all seems to be working well for now.

In the meantime you can use the Mikhail's patch from the bug report.
Looks like my clever idea to save a few mutex calls did not work as
expected. ;-/

-- 
Pekka.Pessi mail at nokia.com

-
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


Re: [Sofia-sip-devel] Memory leaks in 1.12.7

2007-10-24 Thread Michael Jerris
we have this issue already narrowed down to the patch that caused it:

 Mon Oct  8 07:54:24 EDT 2007  [EMAIL PROTECTED]
   * nua.c: nua event callback does not use nua_t object after
nua_destroy()
 call. sf.net bug #1803686

and Pekka said he was going to look into it.  I'll let him respond with any
more details from there, we just reverted that patch from our snapshot and
all seems to be working well for now.

Mike

On 10/24/07, Fabio Margarido [EMAIL PROTECTED] wrote:

 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_ttags[])
 {
   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