Bug 611847 - Thread safety issue - Session::createSender hangs when another thread calls nextReceiver
Summary: Thread safety issue - Session::createSender hangs when another thread calls n...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-cpp
Version: Development
Hardware: All
OS: Linux
high
medium
Target Milestone: 1.3
: ---
Assignee: Gordon Sim
QA Contact: MRG Quality Engineering
URL:
Whiteboard:
Depends On:
Blocks: 612285
TreeView+ depends on / blocked
 
Reported: 2010-07-06 16:37 UTC by Ted Ross
Modified: 2012-12-11 20:44 UTC (History)
3 users (show)

Fixed In Version: 0.10
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 612285 (view as bug list)
Environment:
Last Closed: 2012-12-11 20:31:17 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Apache JIRA QPID-664 0 None None None Never

Description Ted Ross 2010-07-06 16:37:23 UTC
Description of problem:

In a multi-threaded test where one thread loops on Session::nextReceiver and another calls Session::createSender, the call to createSender hangs.

Version-Release number of selected component (if applicable):

MRG1.3 beta4

How reproducible:

100%

Comment 1 Ted Ross 2010-07-06 16:39:36 UTC
pstack output from hanging process:

$ pstack 7602
Thread 3 (Thread 0x7fe5f5ff2910 (LWP 7603)):
#0  0x000000334f6de868 in epoll_wait () from /lib64/libc.so.6
#1  0x00007fe5f6e33fca in qpid::sys::Poller::wait(qpid::sys::Duration) ()
#2  0x00007fe5f6e34639 in qpid::sys::Poller::run() ()
#3  0x00007fe5f6e2aeba in qpid::sys::(anonymous namespace)::runRunnable(void*)
#4  0x000000335020685a in start_thread () from /lib64/libpthread.so.0
#5  0x000000334f6de22d in clone () from /lib64/libc.so.6
#6  0x0000000000000000 in ?? ()
Thread 2 (Thread 0x7fe5effff910 (LWP 7604)):
#0  0x000000335020b54d in pthread_cond_timedwait@@GLIBC_2.3.2 ()
#1  0x00007fe5f791a5d9 in qpid::sys::Condition::wait(qpid::sys::Mutex&, qpid::sys::AbsTime const&) ()
#2  0x00007fe5f791aa6d in qpid::sys::BlockingQueue<boost::shared_ptr<qpid::framing::FrameSet> >::pop(boost::shared_ptr<qpid::framing::FrameSet>&, qpid::sys::Duration) () from /home/ross/svn/qpid/build-vpath/src/.libs/libqpidmessaging.so.2
#3  0x00007fe5f7917ed8 in qpid::client::amqp0_10::IncomingMessages::wait(qpid::sys::Duration) ()
#4  0x00007fe5f791833b in qpid::client::amqp0_10::IncomingMessages::getNextDestination(std::string&, qpid::sys::Duration) ()
#5  0x00007fe5f7921014 in qpid::client::amqp0_10::SessionImpl::nextReceiver(qpid::messaging::Receiver&, qpid::messaging::Duration) ()
#6  0x00007fe5f76ac94e in qmf::AgentSessionImpl::run() ()
#7  0x00007fe5f6e2aeba in qpid::sys::(anonymous namespace)::runRunnable(void*)
#8  0x000000335020685a in start_thread () from /lib64/libpthread.so.0
#9  0x000000334f6de22d in clone () from /lib64/libc.so.6
#10 0x0000000000000000 in ?? ()
Thread 1 (Thread 0x7fe5f5ff3790 (LWP 7602)):
#0  0x000000335020d944 in __lll_lock_wait () from /lib64/libpthread.so.0
#1  0x0000003350208ff0 in _L_lock_1017 () from /lib64/libpthread.so.0
#2  0x0000003350208e51 in pthread_mutex_lock () from /lib64/libpthread.so.0
#3  0x00007fe5f7921d18 in qpid::client::amqp0_10::SessionImpl::createSenderImpl(qpid::messaging::Address const&) ()
#4  0x00007fe5f7929b20 in bool qpid::client::amqp0_10::SessionImpl::execute<qpid::client::amqp0_10::SessionImpl::CreateSender>(qpid::client::amqp0_10::SessionImpl::CreateSender&) ()
#5  0x00007fe5f792214b in qpid::client::amqp0_10::SessionImpl::createSender(qpid::messaging::Address const&) ()
#6  0x00007fe5f78ffc50 in qpid::messaging::Session::createSender(std::string const&) () from /home/ross/svn/qpid/build-vpath/src/.libs/libqpidmessaging.so.2
#7  0x00007fe5f76ae508 in qmf::AgentSessionImpl::sendHeartbeat() ()
#8  0x00007fe5f76af92f in qmf::AgentSessionImpl::open() ()
#9  0x0000000000401652 in main ()

Comment 2 Gordon Sim 2010-07-07 08:56:34 UTC
Fixed on trunk (r960951) and in release repo (http://mrg1.lab.bos.redhat.com/git/?p=qpid.git;a=commitdiff;h=22397fbf439ed2d7f61fa50a85439e3998771fdd).


Note You need to log in before you can comment on or make changes to this bug.