Subject: [Boost-bugs] [Boost C++ Libraries] #12659: Deadlocked with boost::interprocess::managed_mapped_file find
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-12-08 10:16:11
#12659: Deadlocked with boost::interprocess::managed_mapped_file find
-----------------------------+------------------------------
Reporter: soumyadutta13@⦠| Type: Bugs
Status: new | Milestone: To Be Determined
Component: None | Version: Boost 1.61.0
Severity: Problem | Keywords:
-----------------------------+------------------------------
Scenario : I have a existing file which at first is opened & loaded using
{{{
m_file.reset(new
boost::interprocess::managed_mapped_file(boost::interprocess::open_or_create,
file_name.c_str(), m_size));
}}}
then I am using find member function
{{{
Type *vect = m_file->find<Type>(key).first;
}}}
Here my code halts(deadlock).
{{{
boost::interprocess::ipcdetail::posix_recursive_mutex::lock
(this=0x7ffff572d070)
at
/home/dev/build/third_party/64-rhel5/boost_1_59_0/include/boost/interprocess/sync/posix/recursive_mutex.hpp:90
90 if (pthread_mutex_lock(&m_mut) != 0)
(gdb) p m_mut
$1 = {__data = {__lock = 2, __count = 1, __owner = **16792**, __nusers =
1, __kind = 129, __spins = 0, __list = {__prev = 0x0, __next = 0x0}},
__size =
"\002\000\000\000\001\000\000\000\230A\000\000\001\000\000\000\201",
'\000' <repeats 22 times>, __align = 4294967298}
(gdb) info threads all
4 Thread 0x7ffff6af0700 (LWP 23305) 0x00000038dceac6aa in times () from
/lib64/libc.so.6
3 Thread 0x7ffff75dd700 (LWP 23304) 0x00000038dd20b68c in
pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
2 Thread 0x7ffff7fde700 (LWP 23303) 0x00000038dd20eca3 in recvfrom ()
from /lib64/libpthread.so.0
* 1 Thread 0x7ffff7fe27e0 (LWP 23300)
boost::interprocess::ipcdetail::posix_recursive_mutex::lock
(this=0x7ffff572d070)
at
/home/dev/build/third_party/64-rhel5/boost_1_59_0/include/boost/interprocess/sync/posix/recursive_mutex.hpp:90
}}}
If you see here onwer is 16792, but I don't see any such thread.
Some more info.
{{{
p *mp_header
.....
static PayloadPerAllocation = <optimized out>, m_header =
{<boost::interprocess::interprocess_recursive_mutex> = {mutex = {m_mut = {
__data = {__lock = 2, __count = 1, __owner = 16792, __nusers =
1, __kind = 129, __spins = 0, __list = {__prev = 0x0, __next = 0x0}},
__size =
"\002\000\000\000\001\000\000\000\230A\000\000\001\000\000\000\201",
'\000' <repeats 22 times>, __align = 4294967298}}},
m_named_index = .....
}}}
previous mutex informations are still stored.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/12659> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:20 UTC