[asterisk-bugs] [JIRA] (ASTERISK-24768) res_timing_pthread: file descriptor leak

Matt Jordan (JIRA) noreply at issues.asterisk.org
Sun Feb 8 21:27:34 CST 2015


    [ https://issues.asterisk.org/jira/browse/ASTERISK-24768?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=224813#comment-224813 ] 

Matt Jordan commented on ASTERISK-24768:
----------------------------------------

Actually, on second thought, we have to be careful not to introduce a locking inversion here.

Since {{ao2_link}} and {{ao2_unlink}} both lock the underlying container, and the locking in {{pthread_timer_open}} is established as {{pthread_timers}} followed by the {{timing_thread}} lock, the code should first lock the {{pthreads_container}}, then invoke {{ao2_unlink}} using the {{ao2_unlink_flags}} variant with the {{OBJ_NOLOCK}} flag.

> res_timing_pthread: file descriptor leak
> ----------------------------------------
>
>                 Key: ASTERISK-24768
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-24768
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Resources/res_timing_pthread
>    Affects Versions: 13.2.0
>         Environment: Current Debian (jessie/testing), i386, up-to-date
>            Reporter: Matthias Urlichs
>            Assignee: Matthias Urlichs
>         Attachments: timer.patch
>
>
> Pthread timers are never deallocated because their link into the pthread_timers chain is never undone.
> This causes a file descriptor leak (at least two per incoming call).
> The locking in this patch probably needs review; the ao2_unlink() call does not. :-P
> \[Edit:\] *Inline patch removed*



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list