[asterisk-bugs] [JIRA] (ASTERISK-24154) [patch]PTHREAD_MUTEX_INITIALIZER should not be assumed to be recursive mutex

Asterisk Team (JIRA) noreply at issues.asterisk.org
Fri Dec 29 02:09:40 CST 2017


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

Asterisk Team updated ASTERISK-24154:
-------------------------------------

    Assignee: Asterisk Team  (was: Timo Teräs)
      Status: Open  (was: Waiting for Feedback)

> [patch]PTHREAD_MUTEX_INITIALIZER should not be assumed to be recursive mutex
> ----------------------------------------------------------------------------
>
>                 Key: ASTERISK-24154
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-24154
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Core/Portability
>    Affects Versions: 12.4.0
>            Reporter: Timo Teräs
>            Assignee: Asterisk Team
>              Labels: patch
>         Attachments: musl-mutex-init.patch
>
>
> Currently the build system recognizes if PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP is available, and uses it only if detected. If it is not available, PTHREAD_MUTEX_INITIALIZER is used instead. Only on Solaris and BSD, the code revers using constructors to call pthread_mutex_init with proper attributes to create recursive mutex.
> This logic is wrong. PTHREAD_MUTEX_INITIALIZER is not guaranteed to create recursive mutex. Please do that assumption only on GLIBC or other C-libraries where this is a known fact.
> Current code is broken assumably on non-GLIBC systems not explicitly listed. One notable example is musl c-library based Linux systems. 



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



More information about the asterisk-bugs mailing list