Hi,

I'm running 1.12.9 and I'm finding that my process leaks memory
when it is the caller (sends the INVITE) and it terminates the
call (sends the BYE).  However, if the callee terminates the
call, there's no leak.

This is a blocker bug for us, and I don't have a workaround.
I would really appreciate any assistance that anyone has to offer.

Here's the SOFIA_DEBUG 9 trace from a call where the caller sends
the BYE (NOTE: the log was collected on the caller side):

nua: nh_create_handle: entering
nua: nua_handle_bind: entering
nua: nua_invite: entering
nua: nua_stack_set_params: entering
soa_clone(static::0x1001a120, 0x100177f8, 0x10024280) called
soa_set_params(static::0x10025268, ...) called
soa_set_user_sdp(static::0x10025268, (nil), 0x10018eff, -1) called
soa_set_capability_sdp(static::0x10025268, (nil), 0x10018eff, -1) called
su_localinfo: if lo with index 1
su_localinfo: if bridget with index 4
soa_set_params(static::0x10025268, ...) called
nta_leg_tcreate(0x100256d8)
nua(0x10024280): adding session usage
soa_init_offer_answer(static::0x10025268) called
soa_generate_offer(static::0x10025268, 0) called
soa_static_offer_answer_action(0x10025268, soa_generate_offer): called
soa_static(0x10025268, soa_generate_offer): generating local description
su_localinfo: if lo with index 1
su_localinfo: if bridget with index 4
soa_static(0x10025268, soa_generate_offer): upgrade with local description
soa_sdp_mode_set(0x7f5fd868, (nil), ""): called
soa_static(0x10025268, soa_generate_offer): storing local description
soa_get_local_sdp(static::0x10025268, [(nil)], [0x7f5ff990], [0x7f5ff994]) 
called
nta: selecting scheme sip
tport_tsend(0x10022318) tpn = */192.168.0.152:5060
tport_resolve addrinfo = 192.168.0.152:5060
tport_by_addrinfo(0x10022318): not found by name */192.168.0.152:5060
tport_vsend returned 685
nta: sent INVITE (10828982) to */192.168.0.152:5060
tport_pend(0x10022318): pending 0x100264f0 for udp/192.168.0.151:5060 
(already 0)
nta: timer set to 32000 ms
nta: timer shortened to 500 ms
nua(0x10024280): call state changed: init -> calling, sent offer
soa_get_local_sdp(static::0x10025268, [0x7f5ff9a8], [0x7f5ff9ac], [(nil)]) 
called
nua: nua_application_event: entering
nua(0x10024280): sent signal r_invite
tport_wakeup_pri(0x10022318): events IN
tport_recv_event(0x10022318)
tport_recv_iovec(0x10022318) msg 0x10027d00 from (udp/192.168.0.151:5060) 
has 281 bytes, veclen = 1
tport_deliver(0x10022318): msg 0x10027d00 (281 bytes) from 
udp/192.168.0.152:5060/sip next=(nil)
nta: received 100 Trying for INVITE (10828982)
nta: 100 Trying is going to a transaction
nta_outgoing: RTT is 20 ms
tport_release(0x10022318): 0x100264f0 by 0x10027328 with 0x10027d00 
(preliminary)
tport_wakeup_pri(0x10022318): events IN
tport_recv_event(0x10022318)
tport_recv_iovec(0x10022318) msg 0x10027d00 from (udp/192.168.0.151:5060) 
has 486 bytes, veclen = 1
tport_deliver(0x10022318): msg 0x10027d00 (486 bytes) from 
udp/192.168.0.152:5060/sip next=(nil)
nta: received 180 Ringing for INVITE (10828982)
nta: 180 Ringing is going to a transaction
tport_release(0x10022318): 0x100264f0 by 0x10027328 with 0x10027d00 
(preliminary)
nua: nua_application_event: entering
nua(0x10024280): call state changed: calling -> proceeding
nua: nua_application_event: entering
nta: timer not set
tport_wakeup_pri(0x10022318): events IN
tport_recv_event(0x10022318)
tport_recv_iovec(0x10022318) msg 0x10028510 from (udp/192.168.0.151:5060) 
has 664 bytes, veclen = 1
tport_deliver(0x10022318): msg 0x10028510 (664 bytes) from 
udp/192.168.0.152:5060/sip next=(nil)
nta: received 200 OK for INVITE (10828982)
nta: 200 OK is going to a transaction
tport_release(0x10022318): 0x100264f0 by 0x10027328 with 0x10028510
nta: timer set to 32000 ms
soa_set_remote_sdp(static::0x10025268, (nil), 0x10028a3c, 132) called
soa_process_answer(static::0x10025268) called
soa_static_offer_answer_action(0x10025268, soa_process_answer): called
soa_sdp_mode_set(0x10026cf8, 0x10028148, ""): called
soa_static(0x10025268, soa_process_answer): upgrade codecs with remote 
description
soa_activate(static::0x10025268, (nil)) called
nua(0x10024280): INVITE: processed SDP answer in 200 OK
nua: nua_application_event: entering
soa_activate(static::0x10025268, (nil)) called
nta: selecting scheme sip
tport_tsend(0x10022318) tpn = */192.168.0.152:5060
tport_resolve addrinfo = 192.168.0.152:5060
tport_by_addrinfo(0x10022318): not found by name */192.168.0.152:5060
tport_vsend returned 306
nta: sent ACK (10828982) to */192.168.0.152:5060
nua(0x10024280): call state changed: proceeding -> ready, received answer
soa_get_remote_sdp(static::0x10025268, [0x7f5ff6b0], [0x7f5ff6b4], 
[(nil)]) called
soa_get_params(static::0x10025268, ...) called
nua: nua_application_event: entering
nua: nua_application_event: entering
nua: nua_handle_bind: entering
nua: nua_bye: entering
nua(0x10024280): sent signal r_bye
nua: nua_stack_set_params: entering
soa_set_params(static::0x10025268, ...) called
soa_terminate(static::0x10025268) called
soa_init_offer_answer(static::0x10025268) called
nta: selecting scheme sip
tport_tsend(0x10022318) tpn = */192.168.0.152:5060
tport_resolve addrinfo = 192.168.0.152:5060
tport_by_addrinfo(0x10022318): not found by name */192.168.0.152:5060
tport_vsend returned 451
nta: sent BYE (10828983) to */192.168.0.152:5060
tport_pend(0x10022318): pending 0x10025918 for udp/192.168.0.151:5060 
(already 0)
nta: timer shortened to 500 ms
tport_wakeup_pri(0x10022318): events IN
tport_recv_event(0x10022318)
tport_recv_iovec(0x10022318) msg 0x1002a970 from (udp/192.168.0.151:5060) 
has 416 bytes, veclen = 1
tport_deliver(0x10022318): msg 0x1002a970 (416 bytes) from 
udp/192.168.0.152:5060/sip next=(nil)
nta: received 200 OK for BYE (10828983)
nta: 200 OK is going to a transaction
nta_outgoing: RTT is 70 ms
tport_release(0x10022318): 0x10025918 by 0x1002a3a0 with 0x1002a970
nua: nua_application_event: entering
nua(0x10024280): call state changed: terminating -> terminated
nua: nua_application_event: entering
nua: nua_application_event: entering
nua: nua_handle_destroy: entering
nua(0x10024280): sent signal r_destroy
nua(0x10024280): removing session usage
soa_destroy(static::0x10025268) called
nta_leg_destroy(0x100256d8)
nua: terminated session 0x10024280
nta_leg_destroy((nil))
nta: timer set next to 4540 ms
nta: timer K fired, terminate BYE (10828983)
outgoing_reclaim_all((nil), (nil), 0x7f5ffb78)
nta_outgoing_timer: 0/0 resent, 0/1 tout, 1/2 term, 1/3 free
nta: timer set next to 22520 ms
nta: timer D fired, terminate INVITE (10828982)
nta: timer F fired, terminating ACK (10828982)
outgoing_reclaim_all((nil), (nil), 0x7f5ffb78)
nta_outgoing_timer: 0/0 resent, 1/1 tout, 1/1 term, 2/2 free
nta: timer not set

I looked into the home-based allocation code and came across
the statistics code.  I hacked in some code to enable the
statistics on the nua_t object's home just after nua_create
returns.  If I check the memory statistics on the nua_t
object's memory home after carrying out a call in which
the caller sends the BYE (including waiting for all timers
to expire), I see the following on the caller side:

hs_clones: 1
hs_rehash: 0
hs_blocksize: 31
hsp_size: 0
hsp_used: 0
hsa_number: 1
hsa_bytes: 148
hsa_rbytes: 152
hsa_maxrbytes: 152
hsa_preload: 0
hsf_number: 0
hsf_bytes: 0
hsf_rbytes: 0
hsf_preload: 0
hsb_number: 1
hsb_bytes: 148
hsb_rbytes: 152

But, if I restart and carry out a call in which the callee
sends the BYE, then I see the following instead (on the
caller side, after all timers expire):

hs_clones: 1
hs_rehash: 0
hs_blocksize: 31
hsp_size: 0
hsp_used: 0
hsa_number: 1
hsa_bytes: 148
hsa_rbytes: 152
hsa_maxrbytes: 152
hsa_preload: 0
hsf_number: 1
hsf_bytes: 148
hsf_rbytes: 152
hsf_preload: 0
hsb_number: 0
hsb_bytes: 0
hsb_rbytes: 0

It certainly looks to me like something isn't getting freed
in the case where the caller sends the BYE.

Should I go back to 1.12.8?  I read that someone else had gone
back to 1.12.8 to avoid memory leaks in 1.12.9.  I could try
grabbing the latest from Darcs, but I'm nervous about using
that, as it's not a "stable release", and I really do need
stability.

Thanks.

--Jen

Jen T'ai Chitty
Chief Software Engineer, VoIP
VTech Technologies Canada, Ltd.
+1-604-273-5131 ext 849

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel

Reply via email to