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

Crash in QSortFilterProxyModelPrivate::create_mapping_recursive

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 6.3.0, 6.3.1
    • Core: Item Models
    • None

    Description

      With Qt 6.3.0 and Qt 6.3.1 (possibly earlier; not tested) our application crashes in QSortFilterProxyModelPrivate::create_mapping_recursive. Full backtrace attached.

      After checking with a debug compile of qtbase, it hits an assertion

      ASSERT failure in QList::at: "index out of range", file /home/arehn/src/qt6/qtbase/src/corelib/tools/qlist.h, line 459
      

      Arising from

              if (gm->proxy_rows.at(source_parent.row()) == -1 ||
                      gm->proxy_columns.at(source_parent.column()) == -1) {
      

      in QSortFilterProxyModelPrivate::create_mapping_recursive(). The code assumes that proxy_rows for sure is at least as long as source_parent.row() + 1. I'm not sure whether this assumption is warranted; I haven't grokked it completley yet.

      We do have some other proxy models in front of the QSortFilterProxyModel, so I cannot completely rule out that we're exposing an inconsistent model to QSFPM. However, the code is well tested and it works flawlessly with Qt 5.15.

      Attachments

        Activity

          People

            dfaure_kdab David Faure
            msarehn Arno Rehn
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: