Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-1027

QSocketNotifier creates negative refcount

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.12.4
    • 5.12.3
    • PySide
    • None
    • 6108df521065e3a4628ae5656c3cbfd281b6765d (pyside/pyside-setup/5.12)

    Description

      The change "Fix QSocketNotifier constructor" from 2018-05-09, SHA-1 43451e3bc17467593df64cb73ce8c0bf9e60045f, creates a negative refcount.

      The reason was the change from

      Shiboken::AutoDecRef fileNoValue(PyObject_CallObject(fileNo, 0));
      

      to

      Shiboken::AutoDecRef socket(%PYARG_1);
      

      The first version creates a reference that the Shiboken::AutoDecRef later removes when it goes out of scope.
      The second version assigns a variable without creating a reference, and so Shiboken::AutoDecRef removes one reference too much and creates a crash in debug Python.

      This bug was not detected for a long time, because we do not test a debug Python version in COIN. This is bad, because uncaught reference leaks can cause random crashes which are hard to locate.

      Attachments

        For Gerrit Dashboard: PYSIDE-1027
        # Subject Branch Project Status CR V

        Activity

          People

            ctismer Christian Tismer
            ctismer Christian Tismer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes