Bug 634014 - Large persistent messages cause seg fault
Summary: Large persistent messages cause seg fault
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-cpp
Version: 1.2
Hardware: All
OS: Linux
high
high
Target Milestone: 1.2.2
: ---
Assignee: Kim van der Riet
QA Contact: Jeff Needle
URL:
Whiteboard:
Depends On:
Blocks: CVE-2010-3701
TreeView+ depends on / blocked
 
Reported: 2010-09-14 22:11 UTC by Mike Cressman
Modified: 2018-10-27 13:12 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
C: sending a large (> 11 MB) persistent message to a queue C: the broker gets a seg fault F: changed to a more robust memory allocation scheme R: memory is now successfully allocated allowing large persistent messages to be sent
Clone Of:
Environment:
Last Closed: 2010-10-08 01:50:31 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Patch which replaces alloca() with std::vector<char>() (3.26 KB, patch)
2010-09-15 19:21 UTC, Kim van der Riet
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2010:0756 0 normal SHIPPED_LIVE Moderate: Red Hat Enterprise MRG Messaging security and bug fix update 1.2.2 2010-10-08 01:49:47 UTC

Description Mike Cressman 2010-09-14 22:11:09 UTC
Description of problem:
Sending a large (> 11 MB) persistent message to the broker results in a seg fault for the broker.

Version-Release number of selected component (if applicable):
RHEL 5.4
MRG 1.2

How reproducible:
Always

Steps to Reproduce:
1. Start broker with staging-threshold=0 (to avoid other known issues)
2. Run 'perftest --count 1 --size 11000000 --durable yes'
3. Broker will seg fault
  
Actual results:
Broker will seg fault without completing the operation.

Expected results:
Message processed successfully

Additional info:

Comment 1 Mike Cressman 2010-09-14 22:12:31 UTC
This is 1.2 only, works fine with 1.3

Comment 2 Kim van der Riet 2010-09-15 19:21:32 UTC
Created attachment 447552 [details]
Patch which replaces alloca() with std::vector<char>()

The use of ::alloca() to allocate memory from the stack for a message encode buffer is efficient for small messages, but for large messages (>10MB) this can corrupt the stack. The crash occurs when attempting to encode into a buffer allocated using ::alloca(size) and size > 10MB.

I have replaced this with a std::vector<char>() instead and tested it with 100MB-sized messages.

Patch is attached.

Comment 3 Kim van der Riet 2010-09-15 19:24:15 UTC
Note that this patch must be applied *after* the existing mrg_1.2-el5.patch.

Comment 7 Mike Cressman 2010-09-24 15:08:59 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:
C: sending a large (> 11 MB) persistent message to a queue
C: the broker gets a seg fault
F: changed to a more robust memory allocation scheme
R: memory is now successfully allocated allowing large persistent messages to be sent

Comment 13 errata-xmlrpc 2010-10-08 01:50:31 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-0756.html


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