Uploaded image for project: 'Qpid Proton'
  1. Qpid Proton
  2. PROTON-2568

Leak of addrinfo memory held by raw connection

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • proton-c-0.37.0, proton-c-0.38.0
    • proton-c-0.38.0
    • proton-c
    • None

    Description

      This leak can be triggered by running the skupper-router http1 unit test for a single router, example:

      /usr/bin/python3.10 "/home/kgiusti/work/skupper/skupper-router/BUILD/tests/run.py" "-m" "unittest" "-v" "system_tests_http1_adaptor.Http1AdaptorOneRouterTest.test_001_get"

       

      The leak occurs when skupper-router is attempting to connect to a remote HTTP server via a raw connection but shuts down before any raw connection events are processed (e.g. No PN_RAW_CONNECTION_CONNECTED or _DISCONNECTED).

      During shutdown the router frees the proactor and expects any outstanding raw connection resources owned by it to be freed.

      I've traced the proactor shutdown logic, and when the leak occurs there is a final call to praw_connection_cleanup() for the outstanding connection, but the praw_connection_t still holds a pointer to the allocated addrinfo.  praw_connection_cleanup() frees the praw_connection_t but does not call freeaddrinfo(prc->addrinfo) to release the addrinfo memory.

      Attachments

        1. fix.patch
          0.5 kB
          Ken Giusti

        Activity

          People

            astitcher Andrew Stitcher
            kgiusti Ken Giusti
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: