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

Memory leak in QTestLib

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 4.8.0, 5.0.0
    • 4.6.3, 4.7.0
    • Testing: qtestlib
    • None
    • Linux with Valgrid tool
    • 2636e58e748d066096472bc9822f89ba9d4b47a3

    Description

      I am trying to add a memory leak detection feature to QTestLib, so we can find out memory leak during test execution.

      when i am using my updated qtestlib to run several test cases under tests/auto, i found memory leaks in some of them.

      Below is a memory leak in QTestLib component:
      ------------------------------------
      memory leak failure in tests/auto/qsqldatabase, test case precisionPolicy()
      FAIL! : tst_QSqlDatabase::precisionPolicy(0_QSQLITE@/tmp/foo.db) memory leaked (36) bytes

      ------------------------------------
      MemoryLeakAnalysis:
      ->tst_qsqldatabase.cpp, line 1732 (QEXPECT_FAIL("QOCI", "Oracle fails here, to retrieve next", Continue)
      ->qtestcase.cpp, line 1812 (return QTestResult::expectFail(dataIndex, qstrdup(comment), mode, file, line)
      ->qtestresult.cpp, line 195
      if (!isExpectFailData(dataIndex))
      return true; // we don't care

      ------------------------------------
      MemoryLeak Place: src/testlib/qtestresult, line 195
      MemoryLeak Scenario: Since the comment input argument is a newly created string on heap using qstrdup, it should be deleted before return at line 195.

      Although I am testing on 4.6.3 branch, this error still exists on the trunk

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            jasmcdon Jason McDonald (Closed Nokia Identity. Please assign to "macadder" instead) (Inactive)
            jma Johnson Ma
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes