Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-12476

SSL Memory leaks (with screenshots + valgrind report).

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2: Important P2: Important
    • 4.7.0
    • 4.7.0
    • Network: SSL
    • None
    • Mac 10.5
    • d4d7f3575c229848f08c7df75a1281755d6c41a8

      [Update]: this is still a problem on Qt4.7 from the 27th July 2010 - using the test programs enclosed, I can see a memory leak on the client side. I tested using Mac 10.5 where Qt was compiled using -openssl.

      This leak is apparent when using a subclass of the QSslSocket.

      The attached example demonstrates the memory leak, but only with SSL enabled. Non-SSL will use the same class but with no memory leak.

      in order to observe this leak, the server and client in the attached example need to be
      run in separate processes. I just performed a test as follows:

      process 1: >./SSL_Leak_Test 1 1 // this will start a server process
      using SSL

      process 2: > ./SSL_Leak_Test 2 1 // this will start a client process
      using SSL

      where process 2 (the client with the leak) climbs slowly to 9.36MB
      of memory, which is never reclaimed; even after the socket is
      destructed. This is exactly the problem we're having at Filewave.

      I suggest making it more obvious and observable by increasing the
      following parameter in Globals.cpp:
      quint32 LeakGlobals::CLIENT_WRITE_ITERATIONS // from = 50,000 to
      500,000.
      This takes a little while, but you should observe about 52MB of
      memory which is never reclaimed.

        1. with NO ssl (binaries renamed to make roles clear).png
          102 kB
          John Clayton
        2. with SSL (binaries renamed).png
          103 kB
          John Clayton
        3. mem-leak-report-valgrind.txt.zip
          379 kB
          John Clayton
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            phartman Peter Hartmann (closed Nokia identity) (Inactive)
            johncclayton John Clayton
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes