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

Joshua Colp (JIRA) noreply at issues.asterisk.org
Mon Dec 18 09:44:07 CST 2017


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

Joshua Colp updated ASTERISK-24154:
-----------------------------------

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

Is this still a problem such that it can't be used under musl? There is at least one other person who is doing so already.

> [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: Timo Teräs
>         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