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

QSGOpaqueTextureMaterial::compare sometimes segfaults

    XMLWordPrintable

Details

    • 121cfa92daf310df382ddf3d1171ae0d94274f14 (qt/qtdeclarative/5.15.1) 8721196cc73021709ef13e1a6e74aedd34bcfc79 (qt/tqtc-qtdeclarative/5.12) 3df5ad9d247b194401d61c3ffb4b816ec239bded (qt/tqtc-qtdeclarative/6.0)

    Description

      Segfault occurs in the code below.

      QT 5.8

       

      int QSGOpaqueTextureMaterial::compare(const QSGMaterial *o) const
      {
          Q_ASSERT(o && type() == o->type());
          const QSGOpaqueTextureMaterial *other = static_cast<const QSGOpaqueTextureMaterial *>(o);
          if (int diff = m_texture->textureId() - other->texture()->textureId())
              return diff;
          return int(m_filtering) - int(other->m_filtering);
      }

       

      #0 0x0000000000000000 in ()
      #1 0x00007f963f4a0534 in QSGOpaqueTextureMaterial::compare(QSGMaterial const*) const (this=0x75c11d38, o=0x75c076f8)
      at /usr/src/debug/qtdeclarative-opensource-src-5.8.0/src/quick/scenegraph/util/qsgtexturematerial.cpp:315
      #2 0x00007f963f4887a4 in QSGBatchRenderer::Batch::isMaterialCompatible(QSGBatchRenderer::Element*) const (this=<optimized out>, e=e@entry=0x2da8668) at /usr/src/debug/qtdeclarative-opensource-src-5.8.0/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp:627
      #3 0x00007f963f498d91 in QSGBatchRenderer::Renderer::nodeChanged(QSGNode*, QFlags<QSGNode::DirtyStateBit>) (this=0x6f324d40, node=0x75c07530, state=...) at /usr/src/debug/qtdeclarative-opensource-src-5.8.0/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp:1232
      #4 0x00007f963f4822e5 in QSGRootNode::notifyNodeChange(QSGNode*, QFlags<QSGNode::DirtyStateBit>) (this=this@entry=0x6f3225c0, node=node@entry=0x75c07530, state=state@entry=...) at /usr/src/debug/qtdeclarative-opensource-src-5.8.0/src/quick/scenegraph/coreapi/qsgnode.cpp:1285
      #5 0x00007f963f482370 in QSGNode::markDirty(QFlags<QSGNode::DirtyStateBit>) (this=this@entry=0x75c07530, bits=..., bits@entry=...)
      at /usr/src/debug/qtdeclarative-opensource-src-5.8.0/src/quick/scenegraph/coreapi/qsgnode.cpp:678
      #6 0x00007f963f4af3d6 in QSGBasicInternalImageNode::setTexture(QSGTexture*) (this=0x75c07530, texture=<optimized out>)
      at /usr/src/debug/qtdeclarative-opensource-src-5.8.0/src/quick/scenegraph/qsgbasicinternalimagenode.cpp:123
      #7 0x00007f963f58391d in QQuickImage::updatePaintNode(QSGNode*, QQuickItem::UpdatePaintNodeData*) (this=<optimized out>, oldNode=<optimized out>)
      at /usr/src/debug/qtdeclarative-opensource-src-5.8.0/src/quick/items/qquickimage.cpp:731
      #8 0x00007f963f516d07 in QQuickWindowPrivate::updateDirtyNode(QQuickItem*) (this=this@entry=0x6f827840, item=item@entry=0x72db2e30)
      at /usr/src/debug/qtdeclarative-opensource-src-5.8.0/src/quick/items/qquickwindow.cpp:3120
      #9 0x00007f963f517691 in QQuickWindowPrivate::updateDirtyNodes() (this=this@entry=0x6f827840)
      at /usr/src/debug/qtdeclarative-opensource-src-5.8.0/src/quick/items/qquickwindow.cpp:2865
      #10 0x00007f963f518632 in QQuickWindowPrivate::syncSceneGraph() (this=this@entry=0x6f827840)
      at /usr/src/debug/qtdeclarative-opensource-src-5.8.0/src/quick/items/qquickwindow.cpp:420
      #11 0x00007f963f4b35e0 in QSGGuiThreadRenderLoop::renderWindow(QQuickWindow*) (this=0x2d917d0, window=0x6f827780)
      at /usr/src/debug/qtdeclarative-opensource-src-5.8.0/src/quick/scenegraph/qsgrenderloop.cpp:409
      #12 0x00007f963f5211d7 in QQuickWindow::event(QEvent*) (this=0x6f827780, e=0x7ffedc699ce0)
      at /usr/src/debug/qtdeclarative-opensource-src-5.8.0/src/quick/items/qquickwindow.cpp:1577
      #13 0x00007f963e7d9505 in doNotify(QObject*, QEvent*) (receiver=<optimized out>, event=<optimized out>) at kernel/qcoreapplication.cpp:1063
      #14 0x000000000042cf12 in Evs::XOne::QmlApplication::notify(QObject*, QEvent*) (this=<optimized out>, object=<optimized out>, event=<optimized out>)
      at /home/teamcity/buildAgent/work/769f0b28d43491f7/Client/QmlApplication.cpp:24
      #15 0x00007f963e7d95e6 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=receiver@entry=0x6f827780, event=event@entry=0x7ffedc699ce0) at kernel/qcoreapplication.cpp:988
      #16 0x00007f963eb26d0e in QWindowPrivate::deliverUpdateRequest() (event=0x7ffedc699ce0, receiver=0x6f827780)
      at ../../src/corelib/kernel/qcoreapplication.h:231
      #17 0x00007f963eb26d0e in QWindowPrivate::deliverUpdateRequest() (this=<optimized out>) at kernel/qwindow.cpp:2171
      #18 0x00007f963eb2717d in QWindow::event(QEvent*) (this=this@entry=0x6f827780, ev=ev@entry=0x7ffedc69a080) at kernel/qwindow.cpp:2142
      #19 0x00007f963f521185 in QQuickWindow::event(QEvent*) (this=0x6f827780, e=0x7ffedc69a080)
      at /usr/src/debug/qtdeclarative-opensource-src-5.8.0/src/quick/items/qquickwindow.cpp:1596
      #20 0x00007f963e7d9505 in doNotify(QObject*, QEvent*) (receiver=<optimized out>, event=<optimized out>) at kernel/qcoreapplication.cpp:1063
      #21 0x000000000042cf12 in Evs::XOne::QmlApplication::notify(QObject*, QEvent*) (this=<optimized out>, object=<optimized out>, event=<optimized out>)
      at /home/teamcity/buildAgent/work/769f0b28d43491f7/Client/QmlApplication.cpp:24
      #22 0x00007f963e7d95e6 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x6f827780, event=event@entry=0x7ffedc69a080)
      at kernel/qcoreapplication.cpp:988
      #23 0x00007f963e824dae in QTimerInfoList::activateTimers() (event=0x7ffedc69a080, receiver=<optimized out>)
      at ../../src/corelib/kernel/qcoreapplication.h:231
      #24 0x00007f963e824dae in QTimerInfoList::activateTimers() (this=0x2838e60) at kernel/qtimerinfo_unix.cpp:643
      #25 0x00007f963e825599 in idleTimerSourceDispatch(GSource*, GSourceFunc, gpointer) (source=<optimized out>) at kernel/qeventdispatcher_glib.cpp:182
      #26 0x00007f963e825599 in idleTimerSourceDispatch(GSource*, GSourceFunc, gpointer) (source=<optimized out>) at kernel/qeventdispatcher_glib.cpp:229
      #27 0x00007f9634c034c9 in g_main_context_dispatch () at /lib64/libglib-2.0.so.0
      #28 0x00007f9634c03818 in g_main_context_iterate.isra () at /lib64/libglib-2.0.so.0
      #29 0x00007f9634c038cc in g_main_context_iteration () at /lib64/libglib-2.0.so.0
      #30 0x00007f963e8259ac in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x2835120, flags=...)
      at kernel/qeventdispatcher_glib.cpp:423
      #31 0x00007f963e7d829b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7ffedc69a2d0, flags=..., flags@entry=...)
      at kernel/qeventloop.cpp:212
      #32 0x00007f963e7dfd44 in QCoreApplication::exec() () at kernel/qcoreapplication.cpp:1261
      #33 0x00007f963eb13cac in QGuiApplication::exec() () at kernel/qguiapplication.cpp:1657
      #34 0x000000000042a1a4 in main(int32_t, char**) (argc=4, argv=<optimized out>)
      ---Type <return> to continue, or q <return> to quit---
      at /home/teamcity/buildAgent/work/769f0b28d43491f7/Client/main.cpp:266
      
      

       

      The segmentation fault is in Button id : moreActionsButton in the function onClicked

      Here the "partial" code , see at the end.

      we comment the use of property listviewHeader.showMoreActions

       

              Rectangle {
                  id: listviewHeader
                  objectName: "listviewHeader"
      
                  anchors.top: parent.top
                  anchors.left: filterButtonsZone.right
                  anchors.leftMargin: 1
                  anchors.right: parent.right
      
                  height: screensProperties.getScaledHeight(52, libraryPage)
      
                  color: Style.evsThemeColors.evs_gray
      
                  clip: true
      
                  property bool showMoreActions: false
      
                  Button {
                      id: multipleSelectionButton
                      objectName: "multipleSelectionButton"
      
                      visible: false //todo: set to true if deleting multiple medias is supported
      
                      width: screensProperties.getScaledWidth(62, libraryPage)
                      height: rootItem.adaptButtonHeightToEvsTheme(listviewHeader.height, libraryPage)
      
                      anchors.verticalCenter: parent.verticalCenter
                      anchors.left: parent.left
      
                      flat: true
      
                      Material.foreground: Style.evsThemeColors.evs_gray
                      Material.background: Style.evsThemeColors.evs_gray
      
                      onClicked: { mediaLibraryManager.invertMultipleSelectionState(); }
      
                      Label {
                          id: multipleSelectionButtonIcon
                          objectName: "multipleSelectionButtonIcon"
      
                          anchors.fill: parent
      
                          elide: Text.ElideRight
      
                          verticalAlignment: Text.AlignVCenter
                          horizontalAlignment: Text.AlignHCenter
      
                          text: mediaLibraryManager.multipleSelectionEnabled ? Style.icons.fa_check_square : Style.icons.fa_square_o
      
                          font.family: "FontAwesome"
                          font.pixelSize: screensProperties.getScaledHeight(14, libraryPage)
                      }
                  }
      
                  Rectangle {
                      id: separator
      
                      visible: multipleSelectionButton.visible
      
                      anchors.top: parent.top
                      anchors.bottom: parent.bottom
                      anchors.left: multipleSelectionButton.right
      
                      width: screensProperties.getScaledWidth(1, libraryPage)
      
                      color: Style.evsThemeColors.evs_gray_dark
                  }
      
                  Item {
                      id: moreActionsButtonsRow
      
                      anchors.top: parent.top
                      anchors.bottom: parent.bottom
      
                      visible: x < listviewHeader.width - moreActionsButton.width
      
                      width: transitionButton.width + graphicsButton.width + highlightsButton.width + importButton.width + 3*internalProperties.margins
      
                      QtObject {
                          id: internalProperties
      
                          readonly property real margins: screensProperties.getScaledWidth(1, libraryPage)
                      }
      
                      state: "hidden"
      
                      states: [
                          State {
                              name: "hidden"
                              PropertyChanges { target: moreActionsButtonsRow; x: listviewHeader.width - moreActionsButton.width }
                          },
                          State {
                              name: "shown"
                              PropertyChanges { target: moreActionsButtonsRow; x: listviewHeader.width - moreActionsButton.width - moreActionsButtonsRow.width }
                          }
                      ]
      
                      transitions: [ Transition { NumberAnimation { properties: "x"; duration: 300; easing.type: Easing.InOutQuad; } } ]
      
                      Button {
                          id: transitionButton
                          objectName: "transitionButton"
      
                          width: listviewHeader.height
                          height: rootItem.adaptButtonHeightToEvsTheme(listviewHeader.height, libraryPage)
      
                          anchors.verticalCenter: parent.verticalCenter
                          anchors.right: graphicsButton.left
                          anchors.rightMargin: internalProperties.margins
      
      //                    enabled: listviewHeader.showMoreActions //to avoid clicks during animation
      
                          flat: true
      
                          Material.foreground: Style.evsThemeColors.evs_gray_lighter
                          Material.background: Style.evsThemeColors.evs_gray_lighter
      
                          onClicked: {
                              var desiredFolder = mediaLibraryManager.getUsbLocationPath();
                              if (mediaLibraryManager.doesFolderExist(desiredFolder))
                                  fileDialogTransitionSelection.folder = "file://" + desiredFolder;
                              else
                                  fileDialogTransitionSelection.folder = fileDialogTransitionSelection.shortcuts.pictures;
      
                              fileDialogTransitionSelection.open();
                          }
      
                          Label {
                              id: transitionButtonIcon
      
                              anchors.fill: parent
      
                              elide: Text.ElideRight
      
                              verticalAlignment: Text.AlignVCenter
                              horizontalAlignment: Text.AlignHCenter
      
                              text: Style.icons.evs_fade_to
      
                              font.family: "icons-set-evs"
                              font.pixelSize: screensProperties.getScaledHeight(16, libraryPage)
                          }
                      }
      
                      Button {
                          id: graphicsButton
                          objectName: "graphicsButton"
      
                          width: listviewHeader.height
                          height: rootItem.adaptButtonHeightToEvsTheme(listviewHeader.height, libraryPage)
      
                          anchors.verticalCenter: parent.verticalCenter
                          anchors.right: highlightsButton.left
                          anchors.rightMargin: internalProperties.margins
      
      //                    enabled: listviewHeader.showMoreActions //to avoid clicks during animation
      
                          flat: true
      
                          Material.foreground: Style.evsThemeColors.evs_gray_lighter
                          Material.background: Style.evsThemeColors.evs_gray_lighter
      
                          onClicked: { operationViewQML.isEditingGraphics = true; }
      
                          Label {
                              id: graphicsButtonIcon
      
                              anchors.fill: parent
      
                              elide: Text.ElideRight
      
                              verticalAlignment: Text.AlignVCenter
                              horizontalAlignment: Text.AlignHCenter
      
                              text: Style.icons.fa_picture
      
                              font.family: "FontAwesome"
                              font.pixelSize: screensProperties.getScaledHeight(16, libraryPage)
                          }
                      }
      
                      Button {
                          id: highlightsButton
                          objectName: "highlightsButton"
      
                          width: listviewHeader.height
                          height: rootItem.adaptButtonHeightToEvsTheme(listviewHeader.height, libraryPage)
      
                          anchors.verticalCenter: parent.verticalCenter
                          anchors.right: importButton.left
                          anchors.rightMargin: internalProperties.margins
      
      //                    enabled: listviewHeader.showMoreActions //to avoid clicks during animation
      
                          flat: true
      
                          Material.foreground: Style.evsThemeColors.evs_gray_lighter
                          Material.background: Style.evsThemeColors.evs_gray_lighter
      
                          onClicked: { mediaLibraryManager.createHighlight(); }
      
                          Label {
                              id: highlightsButtonIcon
      
                              anchors.fill: parent
      
                              elide: Text.ElideRight
      
                              verticalAlignment: Text.AlignVCenter
                              horizontalAlignment: Text.AlignHCenter
      
                              text: Style.icons.fa_star
      
                              font.family: "FontAwesome"
                              font.pixelSize: screensProperties.getScaledHeight(16, libraryPage)
                          }
                      }
      
                      Button {
                          id: importButton
                          objectName: "importButton"
      
                          width: listviewHeader.height
                          height: rootItem.adaptButtonHeightToEvsTheme(listviewHeader.height, libraryPage)
      
                          anchors.verticalCenter: parent.verticalCenter
                          anchors.right: parent.right
      
      //                    enabled: listviewHeader.showMoreActions //to avoid clicks during animation
      
                          flat: true
      
                          Material.foreground: Style.evsThemeColors.evs_gray_lighter
                          Material.background: Style.evsThemeColors.evs_gray_lighter
      
                          onClicked: {
                              var desiredFolder = mediaLibraryManager.getUsbLocationPath();
                              if (mediaLibraryManager.doesFolderExist(desiredFolder))
                                  fileDialogClipSelection.folder = "file://" + desiredFolder;
                              else
                                  fileDialogClipSelection.folder = fileDialogClipSelection.shortcuts.movies;
      
                              fileDialogClipSelection.open();
                          }
      
                          Label {
                              id: importButtonIcon
      
                              anchors.fill: parent
      
                              elide: Text.ElideRight
      
                              verticalAlignment: Text.AlignVCenter
                              horizontalAlignment: Text.AlignHCenter
      
                              text: Style.icons.fa_sign_in
      
                              font.family: "FontAwesome"
                              font.pixelSize: screensProperties.getScaledHeight(16, libraryPage)
                          }
                      }
                  }
      
                  Button {
                      id: moreActionsButton
                      objectName: "moreActionsButton"
      
                      width: parent.height
                      height: rootItem.adaptButtonHeightToEvsTheme(parent.height, moreActionsButton)
      
                      anchors.verticalCenter: parent.verticalCenter
                      anchors.right: parent.right
      
                      flat: true
      
                      Material.foreground: "#455a64"
                      Material.background: "#455a64"
      
                      onClicked: {
      ---------> dump here when clicked <--------------------------------
      //  listviewHeader.showMoreActions = !listviewHeader.showMoreActions;
      
                      }
      
                      Label {
                          id: moreActionsButtonIcon
      
                          anchors.fill: parent
      
                          elide: Text.ElideRight
      
                          verticalAlignment: Text.AlignVCenter
                          horizontalAlignment: Text.AlignHCenter
      
      //                    text: listviewHeader.showMoreActions ? Style.icons.fa_times : Style.icons.fa_plus
      
                          font.family: "FontAwesome"
                          font.pixelSize: screensProperties.getScaledHeight(24, libraryPage)
                      }
                  }
              }

       

       

      Attachments

        1. 961.tar.gz
          9.59 MB
        2. dump.png
          dump.png
          237 kB
        3. dump3.png
          dump3.png
          334 kB
        4. dump4.png
          dump4.png
          220 kB
        5. image_crash_test.tar.gz
          16 kB
        6. pocqmlvideo.tar.gz
          552 kB
        7. run.png
          run.png
          137 kB
        8. Screenshot from 2018-01-16 13-12-57.png
          Screenshot from 2018-01-16 13-12-57.png
          126 kB

        Issue Links

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

          Activity

            People

              valentyn.doroshchuk Valentyn Doroshchuk
              norbert Norbert Boucher
              Votes:
              0 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes