Summary: | Crash on clicking item in ER diagram | ||
---|---|---|---|
Product: | [Applications] umbrello | Reporter: | Mark Stanton <mark> |
Component: | general | Assignee: | Lays Rodrigues <laysrodriguessilva> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | ralf.habacker |
Priority: | NOR | Keywords: | drkonqi |
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Fedora RPMs | ||
OS: | Linux | ||
Latest Commit: | http://commits.kde.org/umbrello/00f94155ef4ea57991ee56c5a3a83a44fe0e0139 | Version Fixed In: | 2.19.2 (KDE Applications 16.04.2) |
Sentry Crash Report: | |||
Attachments: | Print of test case |
Description
Mark Stanton
2016-05-10 14:59:50 UTC
@Lays: Please check if this could be reproduced with a build from Applications/16.04. Created attachment 98936 [details]
Print of test case
Build a version of stable branch against Qt5.6
If I did right, following the example of use of category in Umbrello Doc. Didn't had any crash.
(In reply to Mark Stanton from comment #0) > Application: umbrello (2.16.0) > KDE Platform Version: 4.14.17 > Qt Version: 4.8.7 > Operating System: Linux 4.4.8-200.fc22.x86_64 x86_64 > Distribution: "Fedora release 22 (Twenty Two)" > > -- Information about the crash: > Clicking on a category in the ER diagram caused Umbrello to crash. It looks hard to reproduce this issue without detailed information of the performed steps from umbrello startup on. Without any further information only the stacktrace can be used to be able to create a fix: > #6 0x000000316de8c2e0 in __cxxabiv1::__dynamic_cast(void const*, > __cxxabiv1::__class_type_info const*, __cxxabiv1::__class_type_info const*, > ptrdiff_t) (src_ptr=0x3609c30, src_type=0x7bf530 <typeinfo for UMLWidget>, > dst_type=0x7bbbe8 <typeinfo for ObjectWidget>, src2dst=0) at > ../../../../libstdc++-v3/libsupc++/dyncast.cc:72 > #7 0x000000000074e925 in UMLScene::onWidgetDestructionBox(QPointF const&) looking at the related source: ObjectWidget * UMLScene::onWidgetDestructionBox(const QPointF &point) const { foreach(UMLWidget* obj, m_WidgetList) { ObjectWidget *ow = dynamic_cast<ObjectWidget*>(obj); According to http://stackoverflow.com/questions/14243854/c-dynamic-cast-causes-a-segfault-even-when-the-object-that-is-casted-is-not-n it looks that m_WidgetList contains an already free'd (dangled) pointer, which fails on the dynamic_cast. There are two solutions for this issue: 1. Find the reason why there is a free'd pointer. This requires detailed informations how to reproduce the crash. 2. Guard m_WidgetList to not hold dangled pointers by using QPointer. Ralf, After looking through and read the QPointer Documentation. I think that the change that I need to to is that: umlwidgetlist.h typedef QList<QPointer<UMLWidget>> UMLWidgetList; typedef QListIterator<QPointer<UMLWidget>> UMLWidgetListIt; But that implies in: Alter all objects and methods that handle with UMLWidget in UMLScene file and others files if need it. Is that the solution that you mean? I using with base the branch with the stable version. (In reply to Lays Rodrigues from comment #4) > Ralf, > After looking through and read the QPointer Documentation. I think that the > change that I need to to is that: > umlwidgetlist.h > typedef QList<QPointer<UMLWidget>> UMLWidgetList; > typedef QListIterator<QPointer<UMLWidget>> UMLWidgetListIt; This is the required change > But that implies in: > Alter all objects and methods that handle with UMLWidget in UMLScene file and others files if need it. > Is that the solution that you mean? You do not need to change every reference. See the following example from http://doc.qt.io/qt-4.8/qpointer.html code without QPointer QLabel* label = new QLabel; label->setText("&Status:"); ... if (label) label->show(); code with QPointer: QPointer<QLabel> label = new QLabel; label->setText("&Status:"); ... if (label) label->show(); It is only required to change the definition and mostly references should work out of the box. Git commit 00f94155ef4ea57991ee56c5a3a83a44fe0e0139 by Ralf Habacker, on behalf of Lays Rodrigues. Committed on 23/05/2016 at 19:47. Pushed by habacker into branch 'Applications/16.04'. Fix 'Crash on clicking item in ER diagram'. The crash has been fixed by making sure that UMLWidgetList do not hold any dangled pointer. REVIEW:127987 FIXED-IN:2.19.2 (KDE Applications 16.04.2) Signed-off-by: Lays Rodrigues <laysrodriguessilva@gmail.com> M +3 -3 umbrello/umlwidgetlist.h http://commits.kde.org/umbrello/00f94155ef4ea57991ee56c5a3a83a44fe0e0139 |