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

Palapeli 1.1 crashes with Qt 4.7

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P1: Critical
    • 4.7.0
    • 4.7.0
    • Widgets: GraphicsView
    • None
    • Qt: compiled from commit d3ae6c6 from 4.7-stable branch, pulled two days ago
      system: openSUSE 11.2, KDE SC 4.5 RC 1 from packages (includes Qt 4.6.3)

    Description

      Fedora Rawhide users have reported in our Bugzilla a regression with Qt 4.7: Palapeli (the KDE jigsaw puzzle game) is crashing when a puzzle is opened.

      With a quite recent 4.7-stable, I was able to reproduce this issue, as well as the observation that the crash happens only in some styles (e.g. Oxygen, Cleanlooks, Plastique). With the Motif style, both me and the Fedora guys have not encountered the issue.

      #67183 0xb6ebddcd in QGraphicsView::sceneRect (this=0x82ad060) at /home/stefan/Code/co/qt/src/gui/graphicsview/qgraphicsview.cpp:1693
      #67184 0xb6ec8719 in QGraphicsViewPrivate::recalculateContentSize (this=0x835e238) at /home/stefan/Code/co/qt/src/gui/graphicsview/qgraphicsview.cpp:373
      #67185 0xb6ec91a3 in QGraphicsView::updateSceneRect (this=0x82ad060, rect=...) at /home/stefan/Code/co/qt/src/gui/graphicsview/qgraphicsview.cpp:2646
      #67186 0xb6eca7e5 in QGraphicsView::qt_metacall (this=0x82ad060, _c=InvokeMetaMethod, _id=4, _a=0xbfffbf28) at .moc/release-shared/moc_qgraphicsview.cpp:161
      #67187 0x0808e88f in Palapeli::View::qt_metacall (this=0x82ad060, _c=InvokeMetaMethod, _id=35, _a=0xbfffbf28)
      at /home/tmp/build/home/stefan/Code/kde/git-kdegames/palapeli/src/view.moc:87
      #67188 0xb72e478a in QMetaObject::metacall (object=0x82ad060, cl=136511224, idx=35, argv=0xbfffbf28)
      at /home/stefan/Code/co/qt/src/corelib/kernel/qmetaobject.cpp:237
      #67189 0xb72f7325 in QMetaObject::activate (sender=0x829a090, m=0x80b59a8, local_signal_index=1, argv=0xbfffbf28)
      at /home/stefan/Code/co/qt/src/corelib/kernel/qobject.cpp:3272
      #67190 0xb6e8c343 in QGraphicsScene::sceneRectChanged (this=0x829a090, _t1=...) at .moc/release-shared/moc_qgraphicsscene.cpp:193
      #67191 0xb6ea21ec in QGraphicsScene::sceneRect (this=0x829a090) at /home/stefan/Code/co/qt/src/gui/graphicsview/qgraphicsscene.cpp:1664
      #67192 0xb6ebddcd in QGraphicsView::sceneRect (this=0x82ad060) at /home/stefan/Code/co/qt/src/gui/graphicsview/qgraphicsview.cpp:1693

      Note that #67183 = #67192, so there's an endless loop. The backtrace ends in QGraphicsView::sizeHint (when the view is initially layouted) on the outer side, and in QCommonStyle on the other one:

      #0 QCommonStyle::sizeFromContents (this=0x80e0250, ct=CT_ScrollBar, opt=0xbf8001d0, csz=..., widget=0x82ea4c8)
      at /home/stefan/Code/co/qt/src/gui/styles/qcommonstyle.cpp:4732
      #1 0xb7965645 in KStyle::sizeFromContents (this=0x80e0250, type=135135824, option=0xbf8001d0, contentsSize=..., widget=0x82ea4c8)
      at /usr/src/debug/kdelibs-4.4.90/kdeui/kernel/kstyle.cpp:4235
      #2 0xb57096eb in Oxygen::Style::sizeFromContents (this=0x80e0250, type=CT_ScrollBar, option=0xbf8001d0, contentsSize=..., widget=0x82ea4c8)
      at /usr/src/debug/kdebase-workspace-4.4.90/kstyles/oxygen/oxygenstyle.cpp:6801
      #3 0xb6ca5dcb in QScrollBar::sizeHint (this=0x82ea4c8) at /home/stefan/Code/co/qt/src/gui/widgets/qscrollbar.cpp:503
      #4 0xb6ce3219 in QAbstractScrollArea::maximumViewportSize (this=0x82f46f8) at /home/stefan/Code/co/qt/src/gui/widgets/qabstractscrollarea.cpp:586
      #5 0xb6ec953c in QGraphicsViewPrivate::recalculateContentSize (this=0x83ad1e8) at /home/stefan/Code/co/qt/src/gui/graphicsview/qgraphicsview.cpp:370
      #6 0xb6ec9ff3 in QGraphicsView::updateSceneRect (this=0x82f46f8, rect=...) at /home/stefan/Code/co/qt/src/gui/graphicsview/qgraphicsview.cpp:2646

      It is not exactly clear why the endless loop suddenly ends, but by observing the QGraphicsScene::sceneRect via QDebug, I found that it grows ten-fold each round. This is probably due to the ConstraintVisualizer item I'm using in Palapeli. Palapeli's sceneRect is set to a fixed size, and the ConstraintVisualizer paints a dark shade outside the sceneRect. The used QGraphicsRectItems are 10 times larger than the sceneRect itself (just to be sure that they're big enough to cover the whole relevant area of the view). The rect items are relayouted in a slot that is connected to QGraphicsScene::sceneRectChanged, so it gets called in this endless loop.

      I therefore have the suspicion that the QGraphicsScene enlarges its sceneRect to include this ConstraintVisualizer item, which it should not do because I have set a fixed sceneRect.

      Please confirm that this is not expected behavior, but a regression.

      Attachments

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

        Activity

          People

            menard Alexis Menard (closed Nokia identity) (Inactive)
            majewsky Stefan Majewsky
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes