Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 505287

Summary: Messages with no content that 'flow to disk' result in protocol errors on delivery
Product: Red Hat Enterprise MRG Reporter: Gordon Sim <gsim>
Component: qpid-cppAssignee: Gordon Sim <gsim>
Status: CLOSED ERRATA QA Contact: Jan Sarenik <jsarenik>
Severity: medium Docs Contact:
Priority: high    
Version: 1.0CC: jsarenik
Target Milestone: 1.3   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
When a message queue reaches a specified limit, its content is released from the memory. Previously, triggering this operation with an empty message caused the broker to send an empty content frame after a header frame that marks the frameset as ended, causing the connection to be terminated. With this update, this error has been fixed, and the connection is no longer accidentally terminated.
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-10-14 16:07:08 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 568788    
Bug Blocks:    
Attachments:
Description Flags
Verification script
none
gdb corefile output none

Description Gordon Sim 2009-06-11 11:02:46 UTC
Description of problem:

If 'flow to disk' is triggered for messages that have no content (i.e. if the content is released from memory because the queue onto which they are placed has reached a specified limit), then on delivery the broker sends an empty content frame after a header frame that marks the frameset as ended. This is a protcol violation and causes the connection to be terminated.

Version-Release number of selected component (if applicable):

Since 1.0

How reproducible:

100%

Steps to Reproduce:
1. create durable queue with fixed depth
2. send messages to exceed depth
3. send an empty message
4. consume messages

E.g.
1. qpid-config add queue test-queue --durable --max-queue-count 5
2. for m in one two three four five six seven "" eight nine ten; do echo $m; done | ./src/tests/sender --send-eos 1
3. ./src/tests/receiver
  
Actual results:

Client closes connection due to protocol violation; broker logs error of the form:

Connection closed by error: Unexpected command continuation frame.

Expected results:

All messages received without error.

Comment 1 Gordon Sim 2009-06-11 11:15:46 UTC
Fixed on qpid trunk by r783721.

Comment 3 Jan Sarenik 2010-02-26 15:09:51 UTC
Created attachment 396555 [details]
Verification script

[root@rhel5x bz505827]# ./runtest
redhat-release-5Server-5.4.0.3 x86_64
qpid-cpp-server-store-0.7.908272-1.el5
qpid-cpp-client-devel-0.7.908272-1.el5
python-qpid-0.5.904641-1.el5
Compiling... done
Configuring queue... ok
Running sender, logging to sender.log...
---------- reciever's output follows
one
two
three
four
five
== receiver exited with 0
---------- sender.log follows
2010-02-26 16:07:00 warning Exception received from broker: resource-limit-exceeded: resource-limit-exceeded: Policy exceeded on test-queue, policy: size: max=104857600, current=19; count: max=5, current=5; type=reject (qpid/broker/QueuePolicy.cpp:83) [caused by 5 \x00:\x00]
Failed: resource-limit-exceeded: resource-limit-exceeded: Policy exceeded on test-queue, policy: size: max=104857600, current=19; count: max=5, current=5; type=reject (qpid/broker/QueuePolicy.cpp:83)
./runtest: line 37:  2999 Done                    for m in one two three four five six seven "" eight nine ten;
do
    echo $m;
done
      3000 Segmentation fault      (core dumped) | ./sender --send-eos 1
==================================================
 Core file dumped. Core analyzation part started.
==================================================
gdb-6.8-37.el5
qpid-cpp-mrg-debuginfo-0.7.908272-1.el5
elfutils-devel-0.137-3.el5
Output files: core.3000.txt

Comment 4 Jan Sarenik 2010-02-26 15:10:39 UTC
Created attachment 396556 [details]
gdb corefile output

Comment 5 Jan Sarenik 2010-02-26 15:12:14 UTC
According to previous comments, I do not think this bug is
fixed. Should I try on that old qpid packages (closer to
r783721) just to make sure that it worked then?

Comment 8 Jan Sarenik 2010-05-25 14:03:10 UTC
Verified, see bug 568788.

Comment 9 Jaromir Hradilek 2010-10-07 16:17:29 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:
When a message queue reaches a specified limit, its content is released from the memory. Previously, triggering this operation with an empty message caused the broker to send an empty content frame after a header frame that marks the frameset as ended, causing the connection to be terminated. With this update, this error has been fixed, and the connection is no longer accidentally terminated.

Comment 11 errata-xmlrpc 2010-10-14 16:07:08 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2010-0773.html