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):
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
Broker will seg fault without completing the operation.
Message processed successfully
This is 1.2 only, works fine with 1.3
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.
Note that this patch must be applied *after* the existing mrg_1.2-el5.patch.
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.
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
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.