Bug 743100 - msgGroups: broker crash when purge/reroute method called for more messages than queue actual messages count
Summary: msgGroups: broker crash when purge/reroute method called for more messages th...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-cpp
Version: Development
Hardware: Unspecified
OS: Unspecified
high
unspecified
Target Milestone: 2.1.2
: ---
Assignee: Ken Giusti
QA Contact: MRG Quality Engineering
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-10-03 20:19 UTC by Petr Matousek
Modified: 2012-12-07 17:45 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause Attempting to purge or move more messages than are present on a message group queue. Consequence The broker will crash. Fix The broker will check if the requested number of messages is present. Result If there are less than the requested number of messages present on the queue, the broker will only move/purge those messages that are present.
Clone Of:
Environment:
Last Closed:
Target Upstream Version:


Attachments (Terms of Use)
test reproducer (1.23 KB, text/python)
2011-10-03 20:21 UTC, Petr Matousek
no flags Details
stack trace (8.71 KB, text/plain)
2011-10-03 20:34 UTC, Petr Matousek
no flags Details
stack_trace2.txt (8.51 KB, text/plain)
2011-10-03 20:34 UTC, Petr Matousek
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 734115 1 None None None 2021-01-20 06:05:38 UTC

Internal Links: 734115

Description Petr Matousek 2011-10-03 20:19:18 UTC
Description of problem:

For the queues defined with the message groups functionality enabled (qpid.group_header_key supplied):
If requested to purge/reroute more than actual messages count in the
non-empty queue (either using qpid-tool or qmf), broker connection is
aborted.

qpidd: ./qpid/broker/MessageGroupManager.h:73: void qpid::broker::MessageGroupManager::unFree(const qpid::broker::MessageGroupManager::GroupState&): Assertion `pos != freeGroups.end() && pos->second == &state' failed.
Exception in do_call: %r (None, 'connection aborted')
qpid: Broker disconnected: Disconnected Broker

The stack trace is attached and contains following error:
UnicodeDecodeError: 'utf8' codec can't decode byte 0xb6 in position 3: unexpected code byte

Please see additional info for more details,

Version-Release number of selected component (if applicable):
qpidd (qpidc) version 0.13
snv branch QPID-3346 (revision 1177617)

How reproducible:
100%

Steps to Reproduce:
1. run the attached test reproducer
  
Actual results:
abort signal on the broker when purge/reroute more messages than actual messages count in the queue

Expected results:
purge/reroute all the messages matching the filter

Additional info:

Moreover consuming messages after "successful" command call (queue contains more messages than requested) leads again to core dump.
The stack trace is attached - stack_trace2.txt.

this can be reproduced using the following change in attached test reproducer:
- result = q.purge(5, {})
+ result = q.purge(1, {})

Comment 1 Petr Matousek 2011-10-03 20:21:35 UTC
Created attachment 526125 [details]
test reproducer

Comment 2 Petr Matousek 2011-10-03 20:34:15 UTC
Created attachment 526128 [details]
stack trace

Comment 3 Petr Matousek 2011-10-03 20:34:45 UTC
Created attachment 526130 [details]
stack_trace2.txt

Comment 4 Ken Giusti 2011-11-02 20:14:26 UTC
Should be fixed as of upstream revision: 1196764

Comment 5 Petr Matousek 2012-01-17 14:39:48 UTC
This issue has been fixed.

Verified on RHEL5.7 and RHEL6.2, architectures: x86_64, i686 

packages installed:
qpid-cpp-mrg-0.14-3.el5
qpid-qmf-0.14-2.el5
qpid-cpp-0.14-1.el6
qpid-qmf-0.14-3.el6

-> VERIFIED

Comment 6 Ken Giusti 2012-03-07 21:52:23 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause
    Attempting to purge or move more messages than are present on a message group queue.
Consequence
    The broker will crash.
Fix
    The broker will check if the requested number of messages is present.
Result
    If there are less than the requested number of messages present on the queue, the broker will only move/purge those messages that are present.


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