[asterisk-bugs] [JIRA] (ASTERISK-25094) PBX core: Investigate thread safety issues

Corey Farrell (JIRA) noreply at issues.asterisk.org
Tue Jun 9 06:59:33 CDT 2015


     [ https://issues.asterisk.org/jira/browse/ASTERISK-25094?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Corey Farrell closed ASTERISK-25094.
------------------------------------

    Resolution: Fixed

> PBX core: Investigate thread safety issues
> ------------------------------------------
>
>                 Key: ASTERISK-25094
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-25094
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Core/PBX
>    Affects Versions: SVN, 11.17.1, 13.3.2
>            Reporter: Corey Farrell
>
> While working on ASTERISK-25085 I found that {{ast_context_find}} and {{ast_context_find_or_create}} are not thread safe. They both return an ast_context, but as soon as these functions run {{ast_unlock_contexts}} it's possible for another thread to cause the context to be freed.
> Any function that works with ast_context pointers (input or output) and runs it's own locking is likely unsafe for the same reason.
> I think we need a _nolock versions of many functions, where the caller would run them with a lock.  For master maybe it would be better for ast_context to become an AO2 object?  This way we could avoid destroying contexts during merge operations, we would just copy references of original contexts that we still need, then unreference everything from the original list when we swap out.



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



More information about the asterisk-bugs mailing list