Håkan Johansson created QPID-7054:
-------------------------------------

             Summary: Crash when closing a sender after the connection has been 
closed (with patch).
                 Key: QPID-7054
                 URL: https://issues.apache.org/jira/browse/QPID-7054
             Project: Qpid
          Issue Type: Bug
          Components: C++ Client
    Affects Versions: qpid-cpp-0.34
         Environment: Red Hat Enterprise Linux Server release 6.7 (Santiago)

The broker is ActiveMQ 5.13.0.
The protocol used in AMQP 1.0.

            Reporter: Håkan Johansson


There will be a crash if you close your _Sender_ after the _Connection_ has 
been closed.

To reproduce, compile and run the attached "crash_test.cc" file.

The test program is very simple. It creates _Connection_, _Session_, and 
_Sender_ instances, then closes the connection explicitly followed by closing 
the sender. The closing of the sender causes an exception to be thrown as the 
connection is dead, but that is caught.

The crash happens when the _Session_ object is destructed at the end of the 
test function. This causes the _SenderContext_ from the sender to be 
destructed, which tries to close the underlying _pn_link_t_ object to be freed, 
but that object is already deleted. The exception during _Sender::close_ 
stopped the proper cleanup to be done.

The _Sender::close_ method calls _ConnectionContext::detach_ to disconnect it 
from its session. I have a attached a patch to this jira which stops the 
_ConnectionContext::detach_ method from trying to do remote actions if not 
connected.

The row numbers in this patch assumes that the patch in QPID-7051 is already 
applied, which might cause some offset warnings when applying this patch.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to