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

QFuture::then(QObject *context, Function &&function) throws "read access violation" when used in chained QFuture

XMLWordPrintable

    • Windows
    • 8
    • 24dedaeaa1 (qt/qtbase/dev) ee349ffba0 (qt/qtbase/6.4) ee349ffba0 (qt/tqtc-qtbase/6.4) 24dedaeaa1 (qt/tqtc-qtbase/dev) 0006a401a4 (qt/tqtc-qtbase/6.2) 018d013181 (qt/qtbase/6.3) 018d013181 (qt/tqtc-qtbase/6.3)
    • Foundation Sprint 65, Foundation Sprint 66

      A chain like:

      #include <QCoreApplication>
      #include <QtConcurrent>
      
      int main(int argc, char* argv[]) 
      {
          auto a = QCoreApplication(argc, argv);
      
          QObject obj(&a);
      
          QtConcurrent::run(
              [] { qDebug() << "block 0"; }
          ).then(
              [] { qDebug() << "block 1"; }
          ).then(
              &obj, [] { qDebug() << "block 2"; }
          );
      
          a.exec();
      }
      

      Produces:

      block 0
      block 1
      Exception thrown: read access violation.
      **_Mem** was 0xFFFFFFFFFFFFFFFF.
      

        

      The problem does not arise when the continuation "block 1" is removed.

       

        1. call_stack.jpg
          156 kB
          Matias Simonetto
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            sonakur Sona Kurazyan
            matias.simon Matias Simonetto
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes