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

invalid access of indicator item inside switch type destructor

    XMLWordPrintable

Details

    • Windows
    • 720ffaeb60 (qt/qtdeclarative/dev) bfb3f8f71b (qt/qtdeclarative/6.3) 79e3420c0c (qt/qtdeclarative/6.2) 720ffaeb60 (qt/qtdeclarative/wip/iosstyle) 79e3420c0c (qt/tqtc-qtdeclarative/6.2) d54285f9e4 (qt/tqtc-qtquickcontrols2/5.15)

    Description

      Hi, I have a switch component whose indicator property is set to an image element having anchors hooked on to the parent switch.

      indicator: Image{
       id:innerImage
       anchors.centerIn: parent
       source: (control.checked) ? checkedIndicator : uncheckedIndicator
      }

      With windows debug build I see a crash in the qml engine (while navagiting away from this page) where the QQmlElement<QQuickSwitch> destructor faults while deleting a child object. This is the primary callstack:

      With runtime verification enabled, if I dump the deallocation history of the faulting address then it shows the below saved deallocation secondary callstack:

      This suggests that the QQmlElement<QQuickSwitch> destructor is trying to double free an already free'd indicator property's image type. I have verified that by commenting out the indicator code the crash does not happen. Wrapping the image inside an Item type also doen't seem to help as the deallocation callstack now show that the offending address was alreday free'd as part of a QQuickItem destruction(see below). Please note that both primary and secondary callstacks are part of the same event loop iteration (endresetModel). The crash does not happen or is masked with Release build.

       

       
       

      Attachments

        1. image-2022-01-08-09-24-43-754.png
          53 kB
          Neelabh Mam
        2. image-2022-01-08-09-28-41-853.png
          9 kB
          Neelabh Mam
        3. image-2022-01-08-09-29-59-808.png
          44 kB
          Neelabh Mam
        4. image-2022-01-08-09-41-39-041.png
          106 kB
          Neelabh Mam
        5. image-2022-01-10-17-04-33-207.png
          15 kB
          Neelabh Mam
        6. image-2022-01-10-17-05-34-625.png
          5 kB
          Neelabh Mam
        7. image-2022-01-10-17-06-03-589.png
          9 kB
          Neelabh Mam
        8. image-2022-01-10-17-50-32-826.png
          39 kB
          Neelabh Mam
        9. image-2022-01-11-00-35-37-506.png
          41 kB
          Neelabh Mam
        10. image-2022-01-11-17-19-46-426.png
          12 kB
          Neelabh Mam
        11. TEST.zip
          7 kB
          Neelabh Mam

        Issue Links

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

          Activity

            People

              ulherman Ulf Hermann
              nmam Neelabh Mam
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes