id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 2391,interprocess_recursive_mutex doesn't work interprocess,Sergey Samsonik ,Ion Gaztañaga,"The recursive mutex tests current thread using detail::get_current_thread_id(), which in turn uses pthread_self(). The latter function returns thread id that unique in context of a process. (As least in CentOS 4.6 'm using.) This results in threads from different processes not being synchronized. Sometimes it results in asserts (in debug build) or exceptions (in release). Attached is a small shared memory test that uses fork() which led me to finding the problem. Environment and test's output: $ g++ -v Reading specs from /usr/lib/gcc/i386-redhat-linux/3.4.6/specs Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-java-awt=gtk --host=i386-redhat-linux Thread model: posix gcc version 3.4.6 20060404 (Red Hat 3.4.6-10) [sergeys@sergeys-vm32 boosttest]$ g++ bug.cc -o bug -I /mnt/builder/3rdParty/boost/v35.0/include -L /mnt/builder/3rdParty/boost/v35.0/lib32 -l rt $ uname -a Linux sergeys-vm32 2.6.9-78.0.1.ELsmp #1 SMP Tue Aug 5 11:02:47 EDT 2008 i686 i686 i386 GNU/Linux $ g++ bug.cc -o bug -I /mnt/builder/3rdParty/boost/v35.0/include -L /mnt/builder/3rdParty/boost/v35.0/lib32 -l rt $ ./bug parent pthread_self -1208224064 child pthread_self -1208224064 bug: /mnt/builder/3rdParty/boost/v35.0/include/boost/interprocess/sync/emulation/interprocess_recursive_mutex.hpp:97: void boost::interprocess::interprocess_recursive_mutex::unlock(): Assertion `detail::equal_thread_id(detail::get_current_thread_id(), m_nOwner)' failed. Aborted Done child Please note, that when built on different system (CentOS 5), the test runs without assertion. But the mutex still doesn't protext the code as intended.",Bugs,closed,Boost 1.38.0,interprocess,Boost 1.35.0,Showstopper,fixed,interprocess fork pthread,