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

QGraphicsItem crashes in destructor

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 4.7.2
    • 4.7.1
    • Widgets: GraphicsView
    • None
    • 46ede046a34c822c612c55fdb1dc93dffe3fc6b6

    Description

      QGraphicsItem crashes in destructor with following backtraces:

      Backtrace 1:
      #0 QGraphicsItem::panel (this=0x6c0079) at graphicsview/qgraphicsitem.cpp:1655
      No locals.
      #1 0x3b87c964 in QGraphicsItemPrivate::setSubFocus (this=0x2e5eb8,
      rootItem=0x0, stopItem=0x0) at graphicsview/qgraphicsitem.cpp:5566
      parent = 0x6c0079
      #2 0x3b889f34 in QGraphicsItemPrivate::setParentItemHelper (this=0x2c4b30,
      newParent=0x0, newParentVariant=<value optimized out>,
      thisPointerVariant=0xaeeecb70) at graphicsview/qgraphicsitem.cpp:1257
      q = 0x2c4aa0
      p = <value optimized out>
      parentFocusScopeItem = 0x0
      newFocusScopeItem = <value optimized out>
      #3 0x3b88a380 in QGraphicsItem::setParentItem (this=0x2c4aa0, newParent=0x0)
      at graphicsview/qgraphicsitem.cpp:1712
      newParentVariant = {d = {data =

      {c = 0 '\000', i = 0, u = 0, b = false, d = -1.2682194472817687e-82, f = 0, real = 0, ll = -5841507435000365056, ull = 12605236638709186560, o = 0x0, ptr = 0x0, shared = 0x0}

      , type = 288, is_shared = 0, is_null = 0}, static
      handler = 0x3bd6ec24}
      thisPointerVariant = {d = {data =

      {c = 160 '\240', i = 2902688, u = 2902688, b = 160, d = 4.4501477170144028e-308, f = 4.06753224e-39, real = 4.06753224e-39, ll = 9393986832452256, ull = 9393986832452256, o = 0x2c4aa0, ptr = 0x2c4aa0, shared = 0x2c4aa0}

      , type = 288, is_shared = 0, is_null = 0}, static handler =
      0x3bd6ec24}
      #4 0x3b8c2998 in QGraphicsScenePrivate::removeItemHelper (this=0x180c60,
      item=0x2c4aa0) at graphicsview/qgraphicsscene.cpp:622
      q = 0x17b800
      oldScene = 0x17b800
      oldSelectedItemsSize = 999208832
      dummy = <value optimized out>
      #5 0x3b88b3d4 in QGraphicsItem::~QGraphicsItem (this=0x2c4aa0,
      __in_chrg=<value optimized out>) at graphicsview/qgraphicsitem.cpp:1486
      p = 0x0
      #6 0x3b8ed4a0 in ~QGraphicsObject (this=0x2c4a98, __in_chrg=<value optimized
      out>) at ../../include/QtGui/../../src/gui/graphicsview/qgraphicsitem.h:547
      No locals.
      #7 QGraphicsWidget::~QGraphicsWidget (this=0x2c4a98, __in_chrg=<value
      optimized out>) at graphicsview/qgraphicswidget.cpp:277

      Backtrace 2:
      Program received signal SIGSEGV, Segmentation fault.
      QGraphicsItemPrivate::clearSubFocus (this=0x0, rootItem=0x29bd40, stopItem=0x0) at graphicsview/qgraphicsitem.cpp:5590
      5590 graphicsview/qgraphicsitem.cpp: No such file or directory.
      in graphicsview/qgraphicsitem.cpp
      (gdb) bt full
      #0 QGraphicsItemPrivate::clearSubFocus (this=0x0, rootItem=0x29bd40, stopItem=0x0) at graphicsview/qgraphicsitem.cpp:5590
      parent = 0x29bd40
      #1 0x3b889c1c in QGraphicsItemPrivate::setParentItemHelper (this=0x2a61c8, newParent=0x0, newParentVariant=<value optimized out>,
      thisPointerVariant=0xaecafba0) at graphicsview/qgraphicsitem.cpp:1115
      q = 0x2a6138
      p = <value optimized out>
      parentFocusScopeItem = <value optimized out>
      newFocusScopeItem = <value optimized out>
      #2 0x3b88a380 in QGraphicsItem::setParentItem (this=0x2a6138, newParent=0x0) at graphicsview/qgraphicsitem.cpp:1712
      newParentVariant = {d = {data =

      {c = 0 '\000', i = 0, u = 0, b = false, d = -2.7781227556831115e-83, f = 0, real = 0, ll = -5851587551445385216, ull = 12595156522264166400, o = 0x0, ptr = 0x0, shared = 0x0}

      , type = 288, is_shared = 0, is_null = 0}, static handler = 0x3bd6ec24}
      thisPointerVariant = {d = {data =

      {c = 56 '8', i = 2777400, u = 2777400, b = 56, d = 4.4501477170144028e-308, f = 3.89196635e-39, real = 3.89196635e-39, ll = 9360073770557752, ull = 9360073770557752, o = 0x2a6138, ptr = 0x2a6138, shared = 0x2a6138}

      , type = 288,
      is_shared = 0, is_null = 0}, static handler = 0x3bd6ec24}
      #3 0x3b8c2998 in QGraphicsScenePrivate::removeItemHelper (this=0x16f810, item=0x2a6138) at graphicsview/qgraphicsscene.cpp:622
      q = 0x16deb0
      oldScene = 0x16deb0
      oldSelectedItemsSize = 999208832
      dummy = <value optimized out>
      #4 0x3b88b3d4 in QGraphicsItem::~QGraphicsItem (this=0x2a6138, __in_chrg=<value optimized out>) at graphicsview/qgraphicsitem.cpp:1486
      p = 0x0
      #5 0x3b8ed4a0 in ~QGraphicsObject (this=0x2a6130, __in_chrg=<value optimized out>) at ../../include/QtGui/../../src/gui/graphicsview/qgraphicsitem.h:547
      No locals.
      #6 QGraphicsWidget::~QGraphicsWidget (this=0x2a6130, __in_chrg=<value optimized out>) at graphicsview/qgraphicswidget.cpp:277

      Patch in attachement "patch" fixes this crash.

      However this patch doesn't solve the root cause for this crash, actual problem is in qgraphicsitem.cpp - row 5592: if (parent->d_ptr->subFocusItem != q_ptr || parent == stopItem)

      In case where crash happens it seems that parent == stopItem has been true, so by removing this condition from if-clause also fixes this problem. However I'm not sure if this affects to other functionality of this class so I think code maintainer should investigate this.

      Original error report can be found in https://projects.maemo.org/bugzilla/show_bug.cgi?id=214064.

      Attachments

        1. patch
          0.6 kB
        2. subfocus_crash.zip
          7 kB
        3. subfocus_crash.zip
          10 kB
        4. subfocus2_crash.zip
          2 kB
        5. unittest-qtbug-16374
          3 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            ylopes Yoann Lopes
            jupakari Juuso Pakarinen
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes