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

crash in QPdfIOHandler if document is deleted too early

    XMLWordPrintable

Details

    • 8c27ae33f (6.7), e3af0e8ae (6.6), db59042dc (6.5), ed49163c8 (dev), 77d2e9ad3 (6.7), fb8b5abb4 (6.6), 56319fbe0 (6.5)

    Description

      tst_MultiPageView::pinchDragPinch crashed sometimes when trying to integrate https://codereview.qt-project.org/c/qt/qtwebengine/+/492698

      One reason is that the document could be deleted before rendering is done:

      1   QPdfDocument::render(int, QSize, QPdfDocumentRenderOptions)                       qpdfdocument.cpp          854 
      2   QPdfIOHandler::read(QImage *)                                                     qpdfiohandler.cpp         113 
      3   QImageReader::read(QImage *)                                                      qimagereader.cpp          1206
      4   readImage(QUrl const&, QIODevice *, QImage *, QString *, QSize *, int *, QRect co qquickpixmapcache.cpp     510 
      5   QQuickPixmapReader::processJob(QQuickPixmapReply *, QUrl const&, QString const&,  qquickpixmapcache.cpp     1011
      6   QQuickPixmapReader::processJobs()                                                 qquickpixmapcache.cpp     860 
      7   ReaderThreadExecutionEnforcer::event(QEvent *)                                    qquickpixmapcache.cpp     759 
      8   QCoreApplicationPrivate::notify_helper(QObject *, QEvent *)                       qcoreapplication.cpp      1312
      9   doNotify(QObject *, QEvent *)                                                     qcoreapplication.cpp      1239
      10  QCoreApplication::notify(QObject *, QEvent *)                                     qcoreapplication.cpp      1222
      11  QGuiApplication::notify(QObject *, QEvent *)                                      qguiapplication.cpp       1994
      12  QCoreApplication::notifyInternal2(QObject *, QEvent *)                            qcoreapplication.cpp      1138
      13  QCoreApplication::sendEvent(QObject *, QEvent *)                                  qcoreapplication.cpp      1581
      14  QCoreApplicationPrivate::sendPostedEvents(QObject *, int, QThreadData *)          qcoreapplication.cpp      1936
      15  QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)        qeventdispatcher_unix.cpp 415 
      16  QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)                  qeventloop.cpp            100 
      17  QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>)                           qeventloop.cpp            191 
      18  QThread::exec()                                                                   qthread.cpp               595 
      19  QQuickPixmapReader::run()                                                         qquickpixmapcache.cpp     1162
      20  QThreadPrivate::start(void *)::$_0::operator()() const                            qthread_unix.cpp          326 
      

      one clue is seeing a null d-pointer in the debugger in this case, sometimes.

      It no longer occurs on dev branch because of https://codereview.qt-project.org/c/qt/qtwebengine/+/534006 : just don't exit too soon, wait for the rendering to be done. But I'm worried about whether a crash-on-exit is also possible in a real application because of this race condition.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              srutledg Shawn Rutledge
              srutledg Shawn Rutledge
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: