id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 8443,Header file inclusion order may cause crashes,Nathan Crookston ,viboes,"pthread/mutex.hpp and pthread/recursive_mutex.hpp both attempt to define the macro BOOST_PTHREAD_HAS_TIMEDLOCK. They each have different conditions for when to define it, which results in different cpp files thinking certain objects are different sizes, and it (hopefully) crashes. While it would be good to provide logic for defining the symbol in one place (mutex.hpp was most recently updated for #3639), I believe that both conditions are wrong: {{{#!c++ #ifdef _POSIX_TIMEOUTS #if _POSIX_TIMEOUTS >= 0 #define BOOST_PTHREAD_HAS_TIMEDLOCK #endif #endif }}} and {{{#!c++ #ifdef _POSIX_TIMEOUTS #if _POSIX_TIMEOUTS >= 0 && _POSIX_C_SOURCE>=200112L #define BOOST_PTHREAD_HAS_TIMEDLOCK #endif #endif }}} I think using _POSIX_C_SOURCE is not right. On our platform (solaris variant), _POSIX_C_SOURCE == 199506L, but _POSIX_TIMEOUTS == 200112L and pthread_mutex_timedlock is available. Thus, I suggest using the following for both conditions (and hopefully testing the condition in one place): {{{#!c++ #if defined(_POSIX_TIMEOUTS) && _POSIX_TIMEOUTS >= 200112L #define BOOST_PTHREAD_HAS_TIMEDLOCK #endif }}} This problem is in trunk starting with at least 1.49, and remains in the current version, as well as trunk.",Bugs,closed,Boost 1.54.0,thread,Boost Release Branch,Problem,fixed,,