Bug 985804 - qpid-snmpd crash if qpidd not running
qpid-snmpd crash if qpidd not running
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-snmpd (Show other bugs)
Development
Unspecified Unspecified
high Severity high
: 3.0
: ---
Assigned To: Ernie
Eric Sammons
: Patch
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-18 05:33 EDT by Leonid Zhaldybin
Modified: 2015-01-22 10:27 EST (History)
3 users (show)

See Also:
Fixed In Version: qpid-snmpd-1.0.0-12.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-01-22 10:27:53 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
qpid-snmpd core dump file. (603.74 KB, application/x-bzip)
2013-07-18 05:41 EDT, Leonid Zhaldybin
no flags Details
Capture exception cause when broker disconnects (69.80 KB, patch)
2013-07-20 10:09 EDT, Ernie
no flags Details | Diff

  None (edit)
Description Leonid Zhaldybin 2013-07-18 05:33:29 EDT
Description of problem:
qpid-snmpd crashes if qpidd broker is not running, and some information is requested from qpid-snmpd. See attachment for the core dump.

[root@lzhaldyb-rhel64i qpidd]# service qpidd start
Starting Qpid AMQP daemon:                                 [  OK  ]
[root@lzhaldyb-rhel64i qpidd]# service qpid-snmpd start
Starting qpid-snmpd:                                       [  OK  ]
[root@lzhaldyb-rhel64i qpidd]# snmpget -v 2c -c public localhost brokerSystemSystemId.0
QPID-MESSAGING-MIB::brokerSystemSystemId.0 = STRING: 074e4fcc--c40-1-48-ae-8-39b-546b36c1bb67
[root@lzhaldyb-rhel64i qpidd]# service qpid-snmpd status
qpid-snmpd (pid 14798) is running...
[root@lzhaldyb-rhel64i qpidd]# service qpidd stop
Stopping Qpid AMQP daemon:                                 [  OK  ]
[root@lzhaldyb-rhel64i qpidd]# service qpid-snmpd status
qpid-snmpd (pid 14798) is running...
[root@lzhaldyb-rhel64i qpidd]# snmpget -v 2c -c public localhost brokerSystemSystemId.0
Timeout: No Response from localhost.
[root@lzhaldyb-rhel64i qpidd]# service qpid-snmpd status
qpid-snmpd dead but subsys locked

Version-Release number of selected component (if applicable):
qpid-snmpd-1.0.0-11.el6

How reproducible:
100%

Steps to Reproduce:
1. service qpidd start
2. service qpid-snmpd start
3. service qpidd stop
4. snmpget -v 2c -c public localhost brokerSystemSystemId.0

Actual results:
no response received by snmpget, qpid-snmpd crashes.

Expected results:
qpid-snmpd does not crash.

Additional info:
Comment 1 Leonid Zhaldybin 2013-07-18 05:41:29 EDT
Created attachment 775233 [details]
qpid-snmpd core dump file.
Comment 3 Ernie 2013-07-20 10:09:35 EDT
Created attachment 776172 [details]
Capture exception cause when broker disconnects
Comment 4 Ernie 2013-07-20 10:11:37 EDT
Committed and pushed a fix in version 1.0.0-12
- Captured exception thrown by qmf.query when broker is disconnected
- Returned SNMP_ERR_NOACCESS when a request is made and broker is disconnected
- Decreased net-snmp cache timeout from 60 seconds to 1 to prevent stale data from being returned when broker is disconnected

Note: qpid-snmpd responds differently when a request is made BEFORE the broker connects than it does when a request is made AFTER a broker is disconnected.
In both cases, there is no broker connection. But the response to a request is different.
Before: The request will timeout
After: A "no access" error will be returned

While not ideal, the changes needed to make the response the same in both cases would be extensive.
Comment 5 Leonid Zhaldybin 2013-08-06 04:28:24 EDT
Tested on RHEL6.4 (both i386 and x86_64). This issue has been fixed. In case that qpidd broker is not running, the qpid-snmpd daemon returns an error when snmp-get is received and continues running without a crash.

Packages used for testing:

python-qpid-0.22-4.el6
python-qpid-qmf-0.22-7.el6
qpid-cpp-client-0.22-8.el6
qpid-cpp-client-devel-0.22-8.el6
qpid-cpp-client-devel-docs-0.22-8.el6
qpid-cpp-client-ssl-0.22-8.el6
qpid-cpp-server-0.22-8.el6
qpid-cpp-server-devel-0.22-8.el6
qpid-cpp-server-ssl-0.22-8.el6
qpid-cpp-server-store-0.22-8.el6
qpid-cpp-server-xml-0.22-8.el6
qpid-java-client-0.22-5.el6
qpid-java-common-0.22-5.el6
qpid-java-example-0.22-5.el6
qpid-jca-0.18-8.el6
qpid-jca-xarecovery-0.18-8.el6
qpid-proton-c-0.4-2.2.el6
qpid-qmf-0.22-7.el6
qpid-snmpd-1.0.0-12.el6
qpid-tools-0.22-3.el6
rh-qpid-cpp-tests-0.22-8.el6

-> VERIFIED

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