[asterisk-dev] [Code Review] Resource leak in SIP/TCP

Mark Michelson reviewboard at asterisk.org
Thu Feb 23 18:35:10 CST 2012


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1714/#review5618
-----------------------------------------------------------

Ship it!


GET THAT IN THERE!

- Mark


On Feb. 13, 2012, 1:33 p.m., rmudgett wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1714/
> -----------------------------------------------------------
> 
> (Updated Feb. 13, 2012, 1:33 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> There is a thread resource leak in SIP-over-TCP or TLS. If a TCP connection fails
> (eg. connection refused), then the thread is torn down, but as the thread is created
> 'joinable' in chan_sip.c:sip_prepare_socket(), and nothing ever pthread_join()'s to it,
> we leak about 240Kb and 2x mmap maps.
> 
> The issue description copied above was not quite true.  There was a joiner, but if the thread
> died on its own, it removed the ability to join it.  Also the thread may or may not have been
> created joinable.
> 
> * _sip_tcp_helper_thread() only needs one parameter since the pvt parameter is only passed in as NULL and never used.
> 
> 
> This addresses bug ASTERISK-19203.
>     https://issues.asterisk.org/jira/browse/ASTERISK-19203
> 
> 
> Diffs
> -----
> 
>   /branches/1.8/channels/chan_sip.c 355008 
>   /branches/1.8/channels/sip/include/sip.h 355008 
>   /branches/1.8/include/asterisk/tcptls.h 355008 
> 
> Diff: https://reviewboard.asterisk.org/r/1714/diff
> 
> 
> Testing
> -------
> 
> I don't have a setup to test the patch.  However, by not creating the thread as
> joinable fixed the issue for the reporter in his original patch.
> 
> Otherwise it compiles. :)
> 
> 
> Thanks,
> 
> rmudgett
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20120224/fe393a99/attachment-0001.htm>


More information about the asterisk-dev mailing list