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

Bug 1618908

Summary: qpid client leaks memory when it connects to an unreachable broker ip address.
Product: Red Hat Enterprise MRG Reporter: Mike Cressman <mcressma>
Component: qpid-cppAssignee: Mike Cressman <mcressma>
Status: CLOSED ERRATA QA Contact: Zdenek Kraus <zkraus>
Severity: high Docs Contact:
Priority: high    
Version: 3.2CC: jross, zkraus
Target Milestone: 3.2.11   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: qpid-cpp-1.36.0-20 Doc Type: Bug Fix
Doc Text:
Cause: If a qpid client attempts to connect to an unreachable broker ip address repeatedly, Consequence: each iteration causes a small memory leak, and this can accumulate over time, causing system memory issues. Fix: Now after a failed connection, the temporary data is freed correctly, Result: and thus repeated attempts to connect will no longer cause memory to accumulate.
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-09-11 17:20:33 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
reproducer to show memory leak none

Description Mike Cressman 2018-08-18 02:28:58 UTC
Created attachment 1476731 [details]
reproducer to show memory leak

Description of problem:
The qpid client leaks memory when it connects to an unreachable broker
ip address.  In some client applications, this is a regular occurrence,
so memory leaks can become significant over time.

Version-Release number of selected component (if applicable):
qpid-cpp-1.36.0-15
(also present in qpid-cpp-0.18-50)

How reproducible:
100%

Steps to Reproduce:
See attached reproducer program
(shows leak when run under valgrind)

Actual results:
some memory is "definitely lost" according to valgrind

Expected results:
no memory "definitely lost"

Additional info:
See below for reproducer instructions.

Comment 1 Mike Cressman 2018-08-18 02:47:03 UTC
To run the reproducer using the attached qpid-client-memleak.cpp source file:

> g++ qpid-client-memleak.cpp -I /usr/include/qpid/messaging/ -lqpidmessaging -lqpidtypes -g -o qpid-client-memleak

> valgrind --log-file=./log-qpid-client-memleak_valgrind.log --leak-check=full --trace-children=yes --error-limit=no ./qpid-client-memleak

Run for at least 10 minutes, then examine the end of the valgrind log.  It should show some memory "definitely lost".

After the fix, this message is no longer there.

Comment 4 Zdenek Kraus 2018-08-28 11:33:10 UTC
Tested on RHEL 6 i386 and x86_64 and RHEL 7 x86_64, with following packages:
qpid-cpp-client-1.36.0-15                                                                                                                                                                                                                                     
qpid-cpp-client-devel-1.36.0-15


Fix works as expected.

-> VERIFIED

Comment 6 Zdenek Kraus 2018-09-05 08:50:58 UTC
Please ignore comment #4 it contains a typo in the version.

Tested on RHEL 6 i386 and x86_64 and RHEL 7 x86_64, with following packages:
qpid-cpp-client-1.36.0-20                                                                                                                                                                                                                               
qpid-cpp-client-devel-1.36.0-20


Fix works as expected.

-> VERIFIED

Comment 8 errata-xmlrpc 2018-09-11 17:20:33 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:2680