Bug 634014 - Large persistent messages cause seg fault
Large persistent messages cause seg fault
Status: CLOSED ERRATA
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-cpp (Show other bugs)
1.2
All Linux
high Severity high
: 1.2.2
: ---
Assigned To: Kim van der Riet
Jeff Needle
:
Depends On:
Blocks: CVE-2010-3701
  Show dependency treegraph
 
Reported: 2010-09-14 18:11 EDT by Mike Cressman
Modified: 2010-11-05 07:10 EDT (History)
4 users (show)

See Also:
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
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-10-07 21:50:31 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Mike Cressman 2010-09-14 18:11:09 EDT
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 18:12:31 EDT
This is 1.2 only, works fine with 1.3
Comment 2 Kim van der Riet 2010-09-15 15:21:32 EDT
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 15:24:15 EDT
Note that this patch must be applied *after* the existing mrg_1.2-el5.patch.
Comment 7 Mike Cressman 2010-09-24 11:08:59 EDT
    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-07 21:50:31 EDT
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.