Bug 976398 - Broker segmentation fault when closing, if ever created a queue federation link
Summary: Broker segmentation fault when closing, if ever created a queue federation link
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-cpp
Version: 2.4
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: 3.0
: ---
Assignee: Ken Giusti
QA Contact: Zdenek Kraus
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-06-20 13:45 UTC by Zdenek Kraus
Modified: 2014-09-24 15:08 UTC (History)
4 users (show)

Fixed In Version: qpid-cpp-0.22-6.el6, qpid-cpp-mrg-0.22-6.el5
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-09-24 15:08:25 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Apache JIRA QPID-4949 0 None None None Never
Red Hat Product Errata RHEA-2014:1296 0 normal SHIPPED_LIVE Red Hat Enterprise MRG Messaging 3.0 Release 2014-09-24 19:00:06 UTC

Description Zdenek Kraus 2013-06-20 13:45:36 UTC
Description of problem:
When broker ever created a federation link during its run, it crash with segmentation fault at the end.

Version-Release number of selected component (if applicable):
qpid-cpp-0.22-4

How reproducible:
100%

Steps to Reproduce:
1. prepare allowing acl
  acl allow all all

2. start brokers with this acl 
  qpidd --auth=no --acl-file=/tmp/allow.acl --data-dir=/tmp/qpidd-$$-$RANDOM-$RANDOM --port=5672
  qpidd --auth=no --acl-file=/tmp/allow.acl --data-dir=/tmp/qpidd-$$-$RANDOM-$RANDOM --port=5671

3. prepare objects to queue route
  qpid-config -b localhost:5671 add queue q
  qpid-config -b localhost:5672 add exchange topic e

4. create a queue route
  qpid-route queue add localhost:5672 localhost:5671 e q

5. end the SOURCE (localhost:5672) broker
  kill <pid-of-source-broker>

Actual results:
2013-06-20 13:40:56 [Store] notice Journal "TplStore": Created
2013-06-20 13:40:56 [Store] notice Store module initialized; store-dir=/tmp/qpidd-2588-20370-20381
2013-06-20 13:40:56 [Security] notice SSL plugin not enabled, you must set --ssl-cert-db to enable it.
2013-06-20 13:40:56 [Broker] notice SASL disabled: No Authentication Performed
2013-06-20 13:40:56 [Network] notice Listening on TCP/TCP6 port 5672
2013-06-20 13:40:56 [Security] notice ACL: Read file "/tmp/allow.acl"
2013-06-20 13:40:56 [Broker] notice Broker running
2013-06-20 13:41:49 [Broker] notice Shut down
Segmentation fault (core dumped)

Expected results:
Broker end normally.

Additional info:
#Backtrace:
(gdb) thread apply all bt

Thread 1 (Thread 0xb7f35720 (LWP 5166)):
#0  0x00000000 in ?? ()
#1  0x05f1fc79 in qpid::management::ManagementAgent::sendBuffer(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::map<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, qpid::types::Variant, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, qpid::types::Variant> > > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, boost::shared_ptr<qpid::broker::Exchange>, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long long) () from /usr/lib/libqpidbroker.so.9
#2  0x05f308ba in qpid::management::ManagementAgent::raiseEvent(qpid::management::ManagementEvent const&, qpid::management::ManagementAgent::severity_t) () from /usr/lib/libqpidbroker.so.9
#3  0x05e66e0a in qpid::broker::ExchangeRegistry::destroy(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) () from /usr/lib/libqpidbroker.so.9
#4  0x05e80142 in qpid::broker::Link::~Link() () from /usr/lib/libqpidbroker.so.9
#5  0x05e8e658 in ?? () from /usr/lib/libqpidbroker.so.9
#6  0x05e8efb7 in std::_Rb_tree<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<qpid::broker::Link> >, std::_Select1st<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<qpid::broker::Link> > >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<qpid::broker::Link> > > >::_M_erase(std::_Rb_tree_node<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<qpid::broker::Link> > >*) () from /usr/lib/libqpidbroker.so.9
#7  0x05e8c207 in qpid::broker::LinkRegistry::~LinkRegistry() () from /usr/lib/libqpidbroker.so.9
#8  0x05db29bb in qpid::broker::Broker::~Broker() () from /usr/lib/libqpidbroker.so.9
#9  0x05dcfe65 in ?? () from /usr/lib/libqpidbroker.so.9
#10 0x0804c803 in qpid::broker::QpiddBroker::execute(qpid::broker::QpiddOptions*) ()
#11 0x0805290e in qpid::broker::run_broker(int, char**, bool) ()
#12 0x0804c15a in main ()

Comment 1 Ken Giusti 2013-06-24 15:40:59 UTC
What is the environment that you've been able to reproduce this on?

I can't cause the crash on my RHEL 6 system (x86_64) with qpid-cpp-0.22-4 installed.

Comment 2 Zdenek Kraus 2013-06-25 06:58:58 UTC
Sorry for the inconvenience, I didn't run all the architectures, I have now.

It's reproducible on i386/i686, RHEL 5 and RHEL 6.


# here is copy-paste reproducer:

echo "acl allow all all" > /tmp/allow.acl
killall qpidd
qpidd --auth=no --acl-file=/tmp/allow.acl --data-dir=/tmp/qpidd-$$-$RANDOM-$RANDOM --port=5672 &
qpidd --auth=no --acl-file=/tmp/allow.acl --data-dir=/tmp/qpidd-$$-$RANDOM-$RANDOM --port=5671 &
sleep 5
qpid-config -b localhost:5671 add queue q
qpid-config -b localhost:5672 add exchange topic e
qpid-route queue add localhost:5672 localhost:5671 e q
sleep 3
kill $(ps -ef | grep qpid | grep 5672 | awk '{print $2};')

Comment 3 Ken Giusti 2013-06-25 20:28:05 UTC
Fix submitted upstream:

http://svn.apache.org/viewvc?view=revision&revision=1496630

Comment 5 Zdenek Kraus 2013-07-01 10:14:38 UTC
This fix looks fine.


This was tested on RHEL 5.9, 6.4 and i686, x86_64:

python-qpid-0.22-4
python-qpid-qmf-0.22-5
qpid-cpp-client-0.22-6
qpid-cpp-client-devel-0.22-6
qpid-cpp-client-devel-docs-0.22-6
qpid-cpp-client-rdma-0.22-6
qpid-cpp-client-ssl-0.22-6
qpid-cpp-server-0.22-6
qpid-cpp-server-devel-0.22-6
qpid-cpp-server-ha-0.22-6
qpid-cpp-server-rdma-0.22-6
qpid-cpp-server-ssl-0.22-6
qpid-cpp-server-store-0.22-6
qpid-cpp-server-xml-0.22-6
qpid-proton-c-0.4-2.2
qpid-qmf-0.22-5
qpid-tools-0.22-2

Comment 6 errata-xmlrpc 2014-09-24 15:08:25 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHEA-2014-1296.html


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