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

Rusty Newton (JIRA) noreply at issues.asterisk.org
Thu Aug 7 09:54:32 CDT 2014


Rusty Newton created ASTERISK-24176:
---------------------------------------

             Summary: [patch]PTHREAD_MUTEX_INITIALIZER should not be assumed to be recursive mutex
                 Key: ASTERISK-24176
                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-24176
             Project: Asterisk
          Issue Type: Bug
      Security Level: None
          Components: Core/Portability
    Affects Versions: 12.4.0
            Reporter: Timo Teräs


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