Uploaded image for project: 'Qpid'
  1. Qpid
  2. QPID-8397

Memory leak in QueueBindings list

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • qpid-cpp-1.40.0
    • None
    • C++ Broker
    • None

    Description

      The Queue remembers the bindings it belongs to in its QueueBindings class. There is an add() but no corresponding remove() method. If repeated bind and unbind operations are done in succession (between the same exchange-queue pair), duplicates pile up in the QueueBindings but not in the exchange binding list.

      The remembered QueueBindings are only ever actively used in two cases: a simple unit_test case and on deletion of the Queue to free its resources, including bindings. Neither case suffers from working with duplicates, aside from the memory waste while the queue is alive. Memory is reclaimed when the queue is destroyed, so valgrind is happy.

      However, some usage patterns can allow many duplicates to accumulate. See

      https://bugzilla.redhat.com/show_bug.cgi?id=1778703

      There is more than one mechanism used within the broker to create a binding:

      Exchange::bind() + Queue::bound()

      Queue::bind() which essentially does the former

      To fix this leak without a refactor, both forms needs to be located in the code and symmetric "unbind" operations need to deallocate the QueueBindings reference.

      Attachments

        Activity

          People

            cliffjansen Clifford Jansen
            cliffjansen Clifford Jansen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: