Bug 720821

Summary: Client aborts when replaying sender after connection recovery
Product: Red Hat Enterprise MRG Reporter: Jason Dillaman <jdillama>
Component: qpid-cppAssignee: messaging-bugs <messaging-bugs>
Status: CLOSED CURRENTRELEASE QA Contact: MRG Quality Engineering <mrgqe-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 1.3CC: gsim, tross
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-03-29 19:58:18 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 698367    
Attachments:
Description Flags
Stack backtrace from crash
none
Suggested patch none

Description Jason Dillaman 2011-07-12 21:44:59 UTC
Description of problem:
There is a race condition between qpid::client::SessionImpl::waitForCompletion and qpid::client::SessionImpl::~SessionImpl.  If one thread is waiting for a completion and another thread causes the destructor for the session to be invoked, the destructor can abort the client if waitForCompletion is still holding the state mutex.  The reason this occurs is because waitForCompletion is not holding a Waiter::ScopedWait, so the destructor completes while the mutex is still being held.  This was discovered when testing connection loss and recovery.

Version-Release number of selected component (if applicable):
qpid-cpp-client-0.7.946106-28_ptc_hotfix_5_v2.el5

How reproducible:
Hard to reproduce, but have had several crashes

Actual results:
The client application aborts due to a failed assertion

Expected results:
The client application should continue to function

Additional info:
See attached backtrace between the two competing threads.

Comment 1 Jason Dillaman 2011-07-12 21:45:47 UTC
Created attachment 512527 [details]
Stack backtrace from crash

Comment 2 Jason Dillaman 2011-07-12 21:46:45 UTC
Created attachment 512528 [details]
Suggested patch

Comment 3 Jason Dillaman 2011-07-12 21:51:32 UTC
See https://issues.apache.org/jira/browse/QPID-3355 for details and proposed
patch

Comment 4 Gordon Sim 2011-07-13 10:02:58 UTC
I believe the fix for this is http://svn.apache.org/viewvc?rev=1145935&view=rev, patch attached to QPID-3355 has also been applied however.

Comment 5 Ted Ross 2012-03-29 19:58:18 UTC
This is in the 0.14 rebase