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

QVariant segfaults with std::list

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • None
    • 6.0.0 RC
    • None
    • 1e0f2be5ac60884f0164f9b9dc2f8cffb21a969a (qt/qtbase/dev)

      The following code segfaults as a result of the `qDebug`:

      #include <QtCore/QDebug>
      #include <QtCore/QVariantHash>
      #include <list>
      
      int main(int, char**)
      {
        std::list<int> sdl;
        auto containerVariant = QVariant::fromValue(sdl);
        QVariantHash vh;
        vh.insert(QStringLiteral("container"), containerVariant);
        QVariant varppp;
        varppp = vh.value(QStringLiteral("container"));
        qDebug() << varppp;
        return 0;
      }
      

      It also segfaults when the `qDebug` is removed, due to the `QVariant` destructor.

       

        For Gerrit Dashboard: QTBUG-87686
        # Subject Branch Project Status CR V

            laknoll Lars Knoll
            steveire Stephen Kelly (Personal)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes