[umbrello] [Bug 347498] valgrind reports memory leaks

Oliver Kellogg bugzilla_noreply at kde.org
Sat Oct 3 21:58:40 BST 2020


https://bugs.kde.org/show_bug.cgi?id=347498

Oliver Kellogg <okellogg at users.sourceforge.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |okellogg at users.sourceforge.
                   |                            |net

--- Comment #8 from Oliver Kellogg <okellogg at users.sourceforge.net> ---
(In reply to Ralf Habacker from comment #1)
> Git commit fe32a49862d7203f450c51c30025b99fcf80c748 by Ralf Habacker.
> Committed on 10/05/2015 at 10:39.
> Pushed by habacker into branch 'Applications/15.04'.
> 
> Fix memory leak not freeing UMLApp instance.
> 
> We use QPointer to avoid access to dangled pointer.
> 
> M  +5    -2    umbrello/main.cpp
> 
> http://commits.kde.org/umbrello/fe32a49862d7203f450c51c30025b99fcf80c748

I experienced the following crash on exiting Umbrello:

Application: Umbrello UML Modeller (umbrello5), signal: Segmentation fault

[KCrash Handler]
#4  0x0000000000471e88 in QListData::size() const (this=0x98) at
/usr/include/qt5/QtCore/qlist.h:115
#5  0x00000000004d156e in QtPrivate::indexOf<QPointer<UMLObject>,
QPointer<UMLObject> >(QList<QPointer<UMLObject> > const&, QPointer<UMLObject>
const&, int) (list=..., u=..., from=0) at /usr/include/qt5/QtCore/qlist.h:1038
#6  0x00000000004d1335 in QList<QPointer<UMLObject>
>::indexOf(QPointer<UMLObject> const&, int) const (this=0x98, t=..., from=0) at
/usr/include/qt5/QtCore/qlist.h:1026
#7  0x00000000004d0f31 in QList<QPointer<UMLObject>
>::removeAll(QPointer<UMLObject> const&) (this=0x98, _t=...) at
/usr/include/qt5/QtCore/qlist.h:936
#8  0x00000000004d0e4a in UMLCanvasObject::subordinates() const (this=0x0) at
/master-af16785/umbrello/uml1model/umlcanvasobject.h:81
#9  0x000000000060a367 in UMLClassifier::getAttributeList() const (this=0x0) at
/master-af16785/umbrello/uml1model/classifier.cpp:439
#10 0x0000000000723b53 in UMLScene::createAutoAttributeAssociations(UMLWidget*)
(this=0x2d57b70, widget=0x2d451e0) at
/master-af16785/umbrello/umlscene.cpp:2635
#11 0x0000000000691449 in UMLWidget::updateWidget() (this=0x2d451e0) at
/master-af16785/umbrello/umlwidgets/umlwidget.cpp:654
#12 0x000000000048ba2c in UMLWidget::qt_static_metacall(QObject*,
QMetaObject::Call, int, void**) (_o=0x2d451e0,
_c=QMetaObject::InvokeMetaMethod, _id=1, _a=0x7ffeed6c24b0) at
/master-af16785/build/umbrello/libumbrello_autogen/IRKO7FPKWT/moc_umlwidget.cpp:111
#13 0x00007fe97d2bc680 in doActivate<false>(QObject*, int, void**)
(sender=0x32ae350, signal_index=3, argv=0x7ffeed6c24b0) at
../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:395
#14 0x000000000048683b in UMLObject::modified() (this=0x32ae350) at
/master-af16785/build/umbrello/libumbrello_autogen/P4742RWANA/moc_umlobject.cpp:219
#15 0x000000000062ecf7 in UMLObject::emitModified() (this=0x32ae350) at
/master-af16785/umbrello/uml1model/umlobject.cpp:389
#16 0x000000000062efed in UMLObject::setUMLStereotype(UMLStereotype*)
(this=0x32ae350, stereo=0x0) at
/master-af16785/umbrello/uml1model/umlobject.cpp:518
#17 0x000000000062e27f in UMLObject::~UMLObject() (this=0x32ae350,
__in_chrg=<optimized out>) at
/master-af16785/umbrello/uml1model/umlobject.cpp:113
#18 0x000000000062ae96 in UMLCanvasObject::~UMLCanvasObject() (this=0x32ae350,
__in_chrg=<optimized out>) at
/master-af16785/umbrello/uml1model/umlcanvasobject.cpp:45
#19 0x0000000000625c8e in UMLPackage::~UMLPackage() (this=0x32ae350,
__in_chrg=<optimized out>) at /master-af16785/umbrello/uml1model/package.cpp:47
#20 0x00000000006086ca in UMLClassifier::~UMLClassifier() (this=0x32ae350,
__in_chrg=<optimized out>) at
/master-af16785/umbrello/uml1model/classifier.cpp:74
#21 0x00000000006086e6 in UMLClassifier::~UMLClassifier() (this=0x32ae350,
__in_chrg=<optimized out>) at
/master-af16785/umbrello/uml1model/classifier.cpp:76
#22 0x00007fe97d2afc7e in QObjectPrivate::deleteChildren() (this=0x2d3a4e0) at
kernel/qobject.cpp:2104
#23 0x00007fe97d2ba854 in QObject::~QObject() (this=<optimized out>,
__in_chrg=<optimized out>) at kernel/qobject.cpp:1082
#24 0x000000000062e3bb in UMLObject::~UMLObject() (this=0x2d53e60,
__in_chrg=<optimized out>) at
/master-af16785/umbrello/uml1model/umlobject.cpp:110
#25 0x000000000062ae96 in UMLCanvasObject::~UMLCanvasObject() (this=0x2d53e60,
__in_chrg=<optimized out>) at
/master-af16785/umbrello/uml1model/umlcanvasobject.cpp:45
#26 0x0000000000625c8e in UMLPackage::~UMLPackage() (this=0x2d53e60,
__in_chrg=<optimized out>) at /master-af16785/umbrello/uml1model/package.cpp:47
#27 0x000000000061963e in UMLFolder::~UMLFolder() (this=0x2d53e60,
__in_chrg=<optimized out>) at /master-af16785/umbrello/uml1model/folder.cpp:48
#28 0x000000000061965a in UMLFolder::~UMLFolder() (this=0x2d53e60,
__in_chrg=<optimized out>) at /master-af16785/umbrello/uml1model/folder.cpp:52
#29 0x00000000006f063a in UMLDoc::~UMLDoc() (this=0x2abc280,
__in_chrg=<optimized out>) at /master-af16785/umbrello/umldoc.cpp:208
#30 0x00000000006f078e in UMLDoc::~UMLDoc() (this=0x2abc280,
__in_chrg=<optimized out>) at /master-af16785/umbrello/umldoc.cpp:216
#31 0x00000000006dda31 in UMLApp::~UMLApp() (this=0x29d3000,
__in_chrg=<optimized out>, __vtt_parm=<optimized out>) at
/master-af16785/umbrello/uml.cpp:262
#32 0x00000000006ddb00 in UMLApp::~UMLApp() (this=0x29d3000,
__in_chrg=<optimized out>, __vtt_parm=<optimized out>) at
/master-af16785/umbrello/uml.cpp:264
#33 0x0000000000471687 in main(int, char**) (argc=2, argv=0x7ffeed6c2da8) at
/master-af16785/umbrello/main.cpp:241

AFAICT the critical place is umlobject.cpp:518 UMLObject::setUMLStereotype(0),
    emitModified();

We should not emit the signal during destruction.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the umbrello-devel mailing list