Bug 149356 - crash on exit after loading phonon design.xmi
Summary: crash on exit after loading phonon design.xmi
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Oliver Kellogg
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-29 22:37 UTC by Oliver Kellogg
Modified: 2013-11-06 17:34 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 4.0.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Kellogg 2007-08-29 22:37:59 UTC
Version:           trunk r706272 (using KDE Devel)
Installed from:    Compiled sources

On loading
http://websvn.kde.org/trunk/KDE/kdelibs/phonon/DESIGN/design.xmi?revision=698532&view=markup
Umbrello crashes as follows:

Program received signal SIGSEGV, Segmentation fault.
0x4200ae9d in __dynamic_cast () from /usr/lib/libstdc++.so.5
(gdb) bt  
#0  0x4200ae9d in __dynamic_cast () from /usr/lib/libstdc++.so.5
#1  0x08321e95 in UMLPackage::removeAllObjects (this=0x84b5668) at /home/kellogg/kdesdk/umbrello/umbrello/package.cpp:170
#2  0x0834c3f1 in UMLDoc::closeDocument (this=0x84b54d0) at /home/kellogg/kdesdk/umbrello/umbrello/umldoc.cpp:286
#3  0x0833fd90 in UMLApp::queryExit (this=0x848ccb8) at /home/kellogg/kdesdk/umbrello/umbrello/uml.cpp:832
#4  0x407e7da8 in KMainWindowPrivate::_k_shuttingDown (this=0x848cea0) at /home/kellogg/kdelibs/kdeui/widgets/kmainwindow.cpp:957
#5  0x407e8181 in KMainWindow::qt_metacall (this=0x848ccb8, _c=InvokeMetaMethod, _id=7, _a=0xbfffed38) at kmainwindow.moc:90
#6  0x4081c2bc in KXmlGuiWindow::qt_metacall (this=0x848ccb8, _c=InvokeMetaMethod, _id=38, _a=0xbfffed38) at kxmlguiwindow.moc:92
#7  0x08344871 in UMLApp::qt_metacall (this=0x848ccb8, _c=InvokeMetaMethod, _id=38, _a=0xbfffed38) at uml.moc:214
#8  0x4016a588 in QMetaObject::activate (sender=0xbfffee80, from_signal_index=4, to_signal_index=4, argv=0x0) at qobject.cpp:3063
#9  0x4016a7a2 in QMetaObject::activate (sender=0xbfffee80, m=0x401d9940, local_signal_index=0, argv=0x0) at qobject.cpp:3125
#10 0x4018dd5e in QCoreApplication::aboutToQuit (this=0xbfffee80) at moc_qcoreapplication.cpp:119
#11 0x40156197 in QCoreApplication::exec () at qcoreapplication.cpp:733
#12 0x416b94b5 in QApplication::exec () at qapplication.cpp:3035
#13 0x083094be in main (argc=2, argv=0xbffff0a4) at /home/kellogg/kdesdk/umbrello/umbrello/main.cpp:111
Comment 1 Bram Schoenmakers 2007-08-29 23:01:20 UTC
Filed twice. See bug 149357.
Comment 2 Oliver Kellogg 2007-08-30 15:00:14 UTC
Clarification: The crash does not happen on loading but on exiting after
the XMI file was loaded. The stack trace given in comment #1 remains valid.
Comment 3 Oliver Kellogg 2007-08-30 15:10:19 UTC
Hmph, I always forget to mention that it only happens when the
advanced code generators are enabled
Comment 4 Oliver Kellogg 2007-09-01 01:09:11 UTC
To my amazement I discover that this also happens without the advanced code
generators enabled.
(But otherwise, the advanced code generators are still terribly crashy.)
Comment 5 Oliver Kellogg 2007-09-01 01:14:56 UTC
SVN commit 707073 by okellogg:

removeAllAssociationEnds(): I tried different iteration schemes (e.g. using
UMLObjectListIt or UMLObjectList::iterator) but the only one that works for me
without crashing is this here, using the integer index and QList::removeAt().
BUG:149356


 M  +2 -1      ChangeLog.2  
 M  +5 -10     umbrello/umlcanvasobject.cpp  


--- trunk/KDE/kdesdk/umbrello/ChangeLog.2 #707072:707073
@@ -15,7 +15,7 @@
       * Found / Lost Messages.
   - Sequence Diagram
       * Pre/Post conditions.
-      * ‘accept time event’ symbol.
+      * "accept time event" symbol.
       * Control Flow.
       * Object Flow.
       * interruptible region.
@@ -31,4 +31,5 @@
 * RMB LogicalView->New->Class in treeview creates TWO classes (144537)
 * New code generator for D language
 * Add option for automatic drawing attribute associations in class diagram (147061)
+* Crash on exit after loading phonon design.xmi (149356)
 * Crash on saving phonon design.xmi with Advanced Code Generators enabled (149357)
--- trunk/KDE/kdesdk/umbrello/umbrello/umlcanvasobject.cpp #707072:707073
@@ -98,16 +98,11 @@
 }
 
 void UMLCanvasObject::removeAllAssociationEnds() {
-    UMLObject *o = NULL;
-    for (UMLObjectListIt oit(m_List); oit.hasNext(); ) {
-        o = oit.next();
+    for (int i = 0; i < m_List.count(); ) {
+        UMLObject *o = m_List.at(i);
         if (o->getBaseType() != Uml::ot_Association) {
-            if ( oit.hasNext() ) {
-                o = oit.next();
-                continue;
-            } else {
-                break;
-            }
+            ++i;
+            continue;
         }
         UMLAssociation *assoc = static_cast<UMLAssociation*>(o);
         //umldoc->slotRemoveUMLObject(assoc);
@@ -133,7 +128,7 @@
         else
             kDebug() << "UMLCanvasObject::removeAllAssociations(" << m_Name
                 << "): objB is NULL" << endl;
-        m_List.remove(assoc);
+        m_List.removeAt(i);
     }
 }
 
Comment 6 Ralf Habacker 2013-11-06 17:34:16 UTC
set version-fixed-in from 4.0.0 changelog