Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
4.7.1
-
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 =
, type = 288, is_shared = 0, is_null = 0}, static
handler = 0x3bd6ec24}
thisPointerVariant = {d = {data =
, 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 =
, type = 288, is_shared = 0, is_null = 0}, static handler = 0x3bd6ec24}
thisPointerVariant = {d = {data =
, 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.