Bug 93219 - crash on loading autosave.xmi
Summary: crash on loading autosave.xmi
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR crash
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-13 19:58 UTC by Martin Koller
Modified: 2004-12-09 08:29 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
autosave from described import (73.04 KB, application/octet-stream)
2004-11-13 19:59 UTC, Martin Koller
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Koller 2004-11-13 19:58:31 UTC
Version:           1.3.90 (using KDE 3.3.89 (CVS >= 20041104), compiled sources)
Compiler:          gcc version 3.2.3
OS:                Linux (i686) release 2.4.22

I tried to import all C++ classes from kdepim/libkcal (which took awful long and used about 400 MBs of memory .. but that's another story).
I have now an autosave.xmi file, which when I try to load, crashes umbrello.
I attach the zipped file here.
Comment 1 Martin Koller 2004-11-13 19:59:36 UTC
Created attachment 8281 [details]
autosave from described import
Comment 2 Jonathan Riddell 2004-11-15 01:24:42 UTC
Code import needs some usability improvements, giving a progress bar and allowing the user interface to respond etc.  That needs a separate entry.

Actually I got an out of memory error with when trying to import libkcal so there's problems there.

However to answer this report current CVS just says there is a problem with the .xmi file attached but doesn't crash so I have to mark this as invalid.

Comment 3 Jonathan Riddell 2004-11-15 01:35:35 UTC
Sorry, tried uncompressing that file and loading it and it does crash.

#5  0x0819f23a in UMLListViewItem::getID (this=0xb1f26d0)
    at /home/jr/devel/kdesdk/umbrello/umbrello/umllistviewitem.cpp:151
#6  0x081a0621 in UMLListViewItem::findItem (this=0xb1f26d0, id=
        {static npos = 4294967295, _M_dataplus = {<std::allocator<char>> = {<No data fields>}, _M_p = 0xb1a29bc "13"}, static _S_empty_rep_storage = {0, 0, 0, 0}}) at /home/jr/devel/kdesdk/umbrello/umbrello/umllistviewitem.cpp:492
#7  0x081a0689 in UMLListViewItem::findItem (this=0xb1f2320, id=
        {static npos = 4294967295, _M_dataplus = {<std::allocator<char>> = {<No data fields>}, _M_p = 0xb1a29bc "13"}, static _S_empty_rep_storage = {0, 0, 0, 0}}) at /home/jr/devel/kdesdk/umbrello/umbrello/umllistviewitem.cpp:496
#8  0x081a0689 in UMLListViewItem::findItem (this=0xb18e550, id=
        {static npos = 4294967295, _M_dataplus = {<std::allocator<char>> = {<No data fields>}, _M_p = 0xb1a29bc "13"}, static _S_empty_rep_storage = {0, 0, 0, 0}}) at /home/jr/devel/kdesdk/umbrello/umbrello/umllistviewitem.cpp:496
#9  0x081a0689 in UMLListViewItem::findItem (this=0x8441380, id=
        {static npos = 4294967295, _M_dataplus = {<std::allocator<char>> = {<No data fields>}, _M_p = 0xb1a29bc "13"}, static _S_empty_rep_storage = {0, 0, 0, 0}}) at /home/jr/devel/kdesdk/umbrello/umbrello/umllistviewitem.cpp:496
#10 0x081a0689 in UMLListViewItem::findItem (this=0x8443798, id=
        {static npos = 4294967295, _M_dataplus = {<std::allocator<char>> = {<No data fields>}, _M_p = 0xb1a29bc "13"}, static _S_empty_rep_storage = {0, 0, 0, 0}}) at /home/jr/devel/kdesdk/umbrello/umbrello/umllistviewitem.cpp:496
#11 0x08196767 in UMLListView::findItem (this=0x8436850, id=
        {static npos = 4294967295, _M_dataplus = {<std::allocator<char>> = {<No data fields>}, _M_p = 0xb1a29bc "13"}, static _S_empty_rep_storage = {0, 0, 0, 0}}) at /home/jr/devel/kdesdk/umbrello/umbrello/umllistview.cpp:818
#12 0x0819bc7e in UMLListView::loadChildrenFromXMI (this=0x8436850, 
    parent=0x8441380, element=@0xbfffe4e0)
    at /home/jr/devel/kdesdk/umbrello/umbrello/umllistview.cpp:2297
#13 0x0819c4a4 in UMLListView::loadChildrenFromXMI (this=0x8436850, 
    parent=0x8443798, element=@0xbfffe570)
    at /home/jr/devel/kdesdk/umbrello/umbrello/umllistview.cpp:2399
#14 0x0819b5b5 in UMLListView::loadFromXMI (this=0x8436850, 
    element=@0xbfffe630)
    at /home/jr/devel/kdesdk/umbrello/umbrello/umllistview.cpp:2236
#15 0x0818e2a5 in UMLDoc::loadExtensionsFromXMI (this=0x8415b28, 
    node=@0xbfffe7d0)
    at /home/jr/devel/kdesdk/umbrello/umbrello/umldoc.cpp:2199
#16 0x0818c611 in UMLDoc::loadFromXMI (this=0x8415b28, file=@0xbfffea00, 
    encode=1) at /home/jr/devel/kdesdk/umbrello/umbrello/umldoc.cpp:1944
#17 0x081844f4 in UMLDoc::openDocument (this=0x8415b28, url=@0xbfffeac0)
    at /home/jr/devel/kdesdk/umbrello/umbrello/umldoc.cpp:445
#18 0x0817b6f0 in UMLApp::slotFileOpen (this=0x83b26d0)
    at /home/jr/devel/kdesdk/umbrello/umbrello/uml.cpp:653
#19 0x0817f9ff in UMLApp::qt_invoke (this=0x83b26d0, _id=78, _o=0xbfffebb0)
    at uml.moc:237
#20 0x40ca851c in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#21 0x40ca8344 in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#22 0x4056ac8b in KAction::activated () from /usr/lib/libkdeui.so.4
#23 0x4056a65f in KAction::slotActivated () from /usr/lib/libkdeui.so.4
#24 0x4056ae91 in KAction::qt_invoke () from /usr/lib/libkdeui.so.4
#25 0x40ca8496 in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#26 0x40ca8344 in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#27 0x40fed27e in QButton::clicked () from /usr/lib/libqt-mt.so.3
#28 0x40d3a96a in QButton::mouseReleaseEvent () from /usr/lib/libqt-mt.so.3
#29 0x40cde687 in QWidget::event () from /usr/lib/libqt-mt.so.3
#30 0x40c4bbbf in QApplication::internalNotify () from /usr/lib/libqt-mt.so.3
#31 0x40c4b2b4 in QApplication::notify () from /usr/lib/libqt-mt.so.3
#32 0x407e1da3 in KApplication::notify () from /usr/lib/libkdecore.so.4
#33 0x40be0630 in QETWidget::translateMouseEvent () from /usr/lib/libqt-mt.so.3
#34 0x40bde2be in QApplication::x11ProcessEvent () from /usr/lib/libqt-mt.so.3
#35 0x40bf5194 in QEventLoop::processEvents () from /usr/lib/libqt-mt.so.3
Comment 4 Oliver Kellogg 2004-11-15 07:52:44 UTC
With current cvs, setting the active language to anything
but C++ or Java before importing, there is no problem.
Setting the active language to C++, import does not crash
(although it does look fishy) but upon saving there is this
crash:

#4  0x40f6874b in QString::QString(QString const&) ()
   from /usr/lib/qt3/lib/libqt-mt.so.3
#5  0x0811c97a in UMLAttribute::getInitialValue() (this=0x9848808)
    at attribute.cpp:52
#6  0x082af691 in CPPCodeClassField::getInitialValue() (this=0xa54ef18)
    at cppcodeclassfield.cpp:83
#7  0x0813c99f in CodeParameter::setAttributesOnNode(QDomDocument&, QDomElement&) (this=0xa54ef18, doc=@0xbfffe040, blockElement=@0xbfffdd50)
    at codeparameter.cpp:171
#8  0x0812dfbd in CodeClassField::setAttributesOnNode(QDomDocument&, QDomElement&) (this=0xa54ef18, doc=@0xbfffe040, cfElem=@0xbfffdd50)
    at codeclassfield.cpp:253
#9  0x0812e6fb in CodeClassField::saveToXMI(QDomDocument&, QDomElement&) (
    this=0xa54ef18, doc=@0xbfffe040, root=@0xbfffdd90)
    at codeclassfield.cpp:329
#10 0x08124a62 in ClassifierCodeDocument::setAttributesOnNode(QDomDocument&, QDomElement&) (this=0x930c7f0, doc=@0xbfffe040, docElement=@0xbfffddf0)
    at classifiercodedocument.cpp:660
#11 0x081248d0 in ClassifierCodeDocument::saveToXMI(QDomDocument&, QDomElement&) (this=0x930c7f0, doc=@0xbfffe040, root=@0xbfffde40)
    at classifiercodedocument.cpp:626
#12 0x0826f992 in CPPCodeGenerator::saveToXMI(QDomDocument&, QDomElement&) (
    this=0x84421b8, doc=@0xbfffe040, root=@0xbfffdef0)
    at cppcodegenerator.cpp:204
#13 0x08189882 in UMLDoc::saveToXMI(QIODevice&) (this=0x8400108, 
    file=@0xbfffe1c0) at umldoc.cpp:1794
#14 0x081837fc in UMLDoc::saveDocument(KURL const&, char const*) (
    this=0x8400108, url=@0xbfffe310) at umldoc.cpp:582
#15 0x0817a111 in UMLApp::slotFileSaveAs() (this=0x83dacf8) at uml.cpp:704
Comment 5 Oliver Kellogg 2004-12-09 08:29:04 UTC
CVS commit by okellogg: 

Use reentrant iterators.
BUG:93219


  M +7 -4      umldoc.cpp   1.210


--- kdesdk/umbrello/umbrello/umldoc.cpp  #1.209:1.210
@@ -1341,10 +1341,12 @@ void UMLDoc::addAssociation(UMLAssociati
         // information was taken from the <UML:AssocWidget> tag.
         UMLAssociationList assocs = getAssociations();
-        UMLAssociation *a;
-        for (a = assocs.first(); a; a = assocs.next()) {
+        for (UMLAssociationListIt ait(assocs); ait.current(); ++ait) {
+                UMLAssociation *a = ait.current();
                 // check if its already been added (shouldnt be the case right now
-                // as UMLAssociations only belong to one associationwidget at a time right now)
+                // as UMLAssociations only belong to one associationwidget at a time)
                 if (a == Assoc)
                 {
+                        kdDebug() << "UMLDoc::addAssociation: duplicate addition attempted"
+                                  << endl;
                         return;
                 }
@@ -1371,5 +1373,6 @@ void UMLDoc::addAssocToConcepts(UMLAssoc
         Uml::IDType BId = a->getObjectId(Uml::B);
         UMLClassifierList concepts = getConcepts();
-        for (UMLClassifier *c = concepts.first(); c; c = concepts.next()) {
+        for (UMLClassifierListIt it(concepts); it.current(); ++it) {
+                UMLClassifier *c = it.current();
                 switch (a->getAssocType()) {
                         // for the next cases should add association to all classes involved