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

ListView segmentation fault when setting highlight to null

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 4.8.0
    • 4.7.3
    • None
    • Win 7
      Symbian^3
      Qt 4.7.3
      Qt pre 4.7.4 203b5edc04143edce0335c5e62de409c64df4c07
    • b9d5cb9334e7d9da71af169802a01f8d344151a7

    Description

      In certain circumstances setting ListView's highlight property to null can cause a segmentation fault. The attached application can be used to reproduce the issue. See also the attached callstack.txt.

      In the application the highlight property is set to null when active focus is lost. Because of this there's a problem in QGraphicsItemPrivate::setVisibleHelper in this loop:

          // Update children with explicitly = false.
          const bool updateChildren = update && !(flags & QGraphicsItem::ItemClipsChildrenToShape);
          foreach (QGraphicsItem *child, children) {
              if (!newVisible || !child->d_ptr->explicitlyHidden)
                  child->d_ptr->setVisibleHelper(newVisible, false, updateChildren);
          }
      

      It seems the iterated QList is modified and deep copied during the loop due to a child getting deleted. After this the QList copy contains a null pointer which causes the fault.

      Attachments

        1. callstack.txt
          5 kB
        2. qtc606.zip
          4 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            martjone Martin Jones (closed Nokia identity) (Inactive)
            suistoma Jussi Suistomaa
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes