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

Segfault in QQuickWidget::resizeEvent on Windows

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.3.1
    • Fix Version/s: 5.4.0
    • Component/s: Quick: Widget
    • Labels:
      None
    • Environment:
    • Commits:
      5494dc7bff733b03eebf73b3da2cff4142c9fc5f

      Description

      Following patch applied to qtdeclarative:

      diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
      index 5c83528..bc67a5e 100644
      — a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
      +++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
      @@ -813,6 +813,8 @@ Renderer::Renderer(QSGRenderContext *ctx)

      // If rendering with an OpenGL Core profile context, we need to create a VAO
      // to hold our vertex specification state.
      + Q_ASSERT(context());
      + Q_ASSERT(context()->openglContext()); //<=== this triggers
      if (context()>openglContext()>format().profile() == QSurfaceFormat::CoreProfile) {
      m_vao = new QOpenGLVertexArrayObject(this);
      m_vao->create();

      Backtrace:

      Qt5Cored.dll!qt_message_fatal(QtMsgType __formal, const QMessageLogContext & context, const QString & message) Line 1357 C++
      Qt5Cored.dll!QMessageLogger::fatal(const char * msg, ...) Line 669 + 0xf bytes C++
      Qt5Cored.dll!qt_assert(const char * assertion, const char * file, int line) Line 2127 + 0x2e bytes C++
      Qt5Quickd.dll!QSGBatchRenderer::Renderer::Renderer(QSGRenderContext * ctx) Line 817 + 0x28 bytes C++
      Qt5Quickd.dll!QSGRenderContext::createRenderer() Line 580 + 0x22 bytes C++
      Qt5Quickd.dll!QQuickWindowPrivate::syncSceneGraph() Line 343 + 0x19 bytes C++
      Qt5Quickd.dll!QQuickRenderControl::sync() Line 161 C++
      Qt5QuickWidgetsd.dll!QQuickWidget::resizeEvent(QResizeEvent * e) Line 875 C++
      Qt5Widgetsd.dll!QWidget::event(QEvent * event) Line 8121 C++
      Qt5QuickWidgetsd.dll!QQuickWidget::event(QEvent * e) Line 1036 C++
      Qt5Widgetsd.dll!QApplicationPrivate::notify_helper(QObject * receiver, QEvent * e) Line 3522 + 0x11 bytes C++
      Qt5Widgetsd.dll!QApplication::notify(QObject * receiver, QEvent * e) Line 3487 + 0x10 bytes C++
      Qt5Cored.dll!QCoreApplication::notifyInternal(QObject * receiver, QEvent * event) Line 935 + 0x15 bytes C++
      Qt5Cored.dll!QCoreApplication::sendEvent(QObject * receiver, QEvent * event) Line 237 + 0x39 bytes C++
      Qt5Widgetsd.dll!QWidgetPrivate::sendPendingMoveAndResizeEvents(bool recursive, bool disableUpdates) Line 7072 + 0xe bytes C++
      Qt5Widgetsd.dll!QWidgetPrivate::show_helper() Line 7126 C++
      Qt5Widgetsd.dll!QWidgetPrivate::show_recursive() Line 7054 C++
      Qt5Widgetsd.dll!QWidgetPrivate::showChildren(bool spontaneous) Line 7471 C++
      Qt5Widgetsd.dll!QWidgetPrivate::show_helper() Line 7136 C++
      Qt5Widgetsd.dll!QWidget::setVisible(bool visible) Line 7391 C++
      Qt5Widgetsd.dll!QWidget::show() Line 7031 C++
      Qt5Widgetsd.dll!QWidgetPrivate::showChildren(bool spontaneous) Line 7474 C++
      Qt5Widgetsd.dll!QWidgetPrivate::show_helper() Line 7136 C++
      Qt5Widgetsd.dll!QWidget::setVisible(bool visible) Line 7391 C++
      Qt5Widgetsd.dll!QWidget::show() Line 7031 C++
      Qt5Widgetsd.dll!QWidgetPrivate::showChildren(bool spontaneous) Line 7474 C++
      Qt5Widgetsd.dll!QWidgetPrivate::show_helper() Line 7136 C++
      Qt5Widgetsd.dll!QWidgetPrivate::show_recursive() Line 7054 C++
      Qt5Widgetsd.dll!QWidgetPrivate::showChildren(bool spontaneous) Line 7471 C++
      Qt5Widgetsd.dll!QWidgetPrivate::show_helper() Line 7136 C++
      Qt5Widgetsd.dll!QWidget::setVisible(bool visible) Line 7391 C++
      Qt5Widgetsd.dll!QWidget::show() Line 7031 C++
      Qt5Widgetsd.dll!QStackedLayout::setCurrentIndex(int index) Line 337 C++
      Cored.dll!Core::Internal::FancyTabWidget::showWidget(int index) Line 514 C++

      Background:

      A QtCreator plugin that does something like
      myWidget->layout()->removeWidget(myQtQuickWidget1);
      myWidget->layout()->addWidget(myQtQuickWidget2);
      myWidget->layout()->removeWidget(myQtQuickWidget2);
      myWidget->layout()->addWidget(myQtQuickWidget1);

      Note that the calls above may happen while myQtQuickWidget* are not visible. The segfault only happens once QtCreator mode is switched (from "Edit" to "Design") and the current myQtQuickWidget* becomes visible, in which case another removeWidget/addWidget-sequence is triggered which leads to the segfault.

        Attachments

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

          Activity

            People

            Assignee:
            lagocs Laszlo Agocs
            Reporter:
            sebsauer Sebastian Sauer
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes