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

QVariant segfaults with std::list

    XMLWordPrintable

Details

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

    Description

      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.

       

      Attachments

        Issue Links

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

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes