Summary: | Crash when reordering attributes | ||
---|---|---|---|
Product: | [Applications] umbrello | Reporter: | Christoph Bartoschek <bartoschek> |
Component: | general | Assignee: | Umbrello Development Group <umbrello-devel> |
Status: | RESOLVED WORKSFORME | ||
Severity: | crash | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Christoph Bartoschek
2005-01-03 14:59:54 UTC
I can confirm this problem for KDE 3.3 branch, it goes away if you choose a non-complex code generator and remove the C++ code generation from the XMI file. This sequence of events also causes crash in HEAD brach but the crash is on point number 9. Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1". [Thread debugging using libthread_db enabled] [New Thread -1231761280 (LWP 9386)] [KCrash handler] #4 0xb73120c2 in QGListIterator::QGListIterator () from /usr/lib/libqt-mt.so.3 #5 0x081214fe in QPtrListIterator (this=0xbfffe8f0, l=@0x180) at qptrlist.h:157 #6 0x081c09dc in UMLView::getWidgetAssocs (this=0x0, Obj=0x86be7e8, Associations=@0x871c5b4) at /home/jr/devel/kdesdk/umbrello/umbrello/umlview.cpp:2081 #7 0x0825cf70 in AssocPage::fillListBox (this=0x871c530) at /home/jr/devel/kdesdk/umbrello/umbrello/dialogs/assocpage.cpp:78 #8 0x0825cb67 in AssocPage (this=0x871c530, parent=0x871c178, v=0x0, o=0x86be7e8) at /home/jr/devel/kdesdk/umbrello/umbrello/dialogs/assocpage.cpp:38 #9 0x0823793e in ClassPropDlg::setupPages (this=0x86d9f10, c=0x86be7e8, assoc=true) at /home/jr/devel/kdesdk/umbrello/umbrello/dialogs/classpropdlg.cpp:218 #10 0x08236748 in ClassPropDlg (this=0x86d9f10, parent=0x84c7820, w=0x86fe030) at /home/jr/devel/kdesdk/umbrello/umbrello/dialogs/classpropdlg.cpp:98 #11 0x0819f326 in UMLDoc::showProperties (this=0x84e90a8, o=0x86fe030) at /home/jr/devel/kdesdk/umbrello/umbrello/umldoc.cpp:2616 #12 0x081cbaad in UMLWidget::slotMenuSelection (this=0x86fe030, sel=1979) at /home/jr/devel/kdesdk/umbrello/umbrello/umlwidget.cpp:446 #13 0x08131ec1 in ClassWidget::slotMenuSelection (this=0x86fe030, sel=1979) at /home/jr/devel/kdesdk/umbrello/umbrello/classwidget.cpp:309 #14 0x081cc105 in UMLWidget::mouseDoubleClickEvent (this=0x86fe030, me=0x85a4b70) at /home/jr/devel/kdesdk/umbrello/umbrello/umlwidget.cpp:597 #15 0x0817f63e in ToolBarState::mouseDoubleClick (this=0x86fdd18, ome=0xbfffecc0) at /home/jr/devel/kdesdk/umbrello/umbrello/toolbarstate.cpp:112 #16 0x0818020e in ToolBarStateArrow::mouseDoubleClick (this=0x86fdd18, ome=0xbfffecc0) at /home/jr/devel/kdesdk/umbrello/umbrello/toolbarstatearrow.cpp:100 #17 0x081bafb1 in UMLView::contentsMouseDoubleClickEvent (this=0x86c1178, ome=0xbfffecc0) at /home/jr/devel/kdesdk/umbrello/umbrello/umlview.cpp:846 #18 0xb716ffd2 in QScrollView::viewportMouseDoubleClickEvent () from /usr/lib/libqt-mt.so.3 #19 0xb716f7ca in QScrollView::eventFilter () from /usr/lib/libqt-mt.so.3 #20 0xb7057e4e in QObject::activate_filters () from /usr/lib/libqt-mt.so.3 #21 0xb7057d7c in QObject::event () from /usr/lib/libqt-mt.so.3 #22 0xb70905ff in QWidget::event () from /usr/lib/libqt-mt.so.3 #23 0xb6ffdbbf in QApplication::internalNotify () from /usr/lib/libqt-mt.so.3 #24 0xb6ffd2b4 in QApplication::notify () from /usr/lib/libqt-mt.so.3 #25 0xb76944f0 in KApplication::notify (this=0xbffff750, receiver=0x86bf4f0, event=0xbffff1b0) at /home/jr/devel/kdelibs/kdecore/kapplication.cpp:543 #26 0xb6f92630 in QETWidget::translateMouseEvent () from /usr/lib/libqt-mt.so.3 #27 0xb6f902be in QApplication::x11ProcessEvent () from /usr/lib/libqt-mt.so.3 #28 0xb6fa7194 in QEventLoop::processEvents () from /usr/lib/libqt-mt.so.3 #29 0xb700ff18 in QEventLoop::enterLoop () from /usr/lib/libqt-mt.so.3 #30 0xb700fdc8 in QEventLoop::exec () from /usr/lib/libqt-mt.so.3 #31 0xb6ffde11 in QApplication::exec () from /usr/lib/libqt-mt.so.3 #32 0x081663b5 in main (argc=1, argv=0xbffff8f4) at /home/jr/devel/kdesdk/umbrello/umbrello/main.cpp:91 Jonathan Riddell wrote:
> This sequence of events also causes crash in HEAD branch but
> the crash is on point number 9.
Tried it with the C++ generators old and new, cannot confirm.
CVS HEAD has been in motion these days, did you "make clean"?
BTW, while attempting to reproduce this problem I found a different one: The changed attribute/operation order is not reflected in the list view, and is not preserved upon reload. I have fixed that and will commit as soon as CVS becomes warmer again. Seems to work in CVS HEAD now. CVS commit by okellogg: compare(): Reflect the changed attribute/operation order in the list view and restore it upon reload. CCBUG:96216 M +34 -4 umllistviewitem.cpp 1.68 --- kdesdk/umbrello/umbrello/umllistviewitem.cpp #1.67:1.68 @@ -522,10 +522,40 @@ void UMLListViewItem::cancelRename(int c int UMLListViewItem::compare(QListViewItem *other, int col, bool ascending) const { + UMLListViewItem *ulvi = static_cast<UMLListViewItem*>(other); Uml::ListView_Type ourType = getType(); - Uml::ListView_Type otherType = static_cast<UMLListViewItem*>( other )->getType(); + Uml::ListView_Type otherType = ulvi->getType(); - if ( ourType == otherType ) + if ( ourType == otherType ) { + UMLObject *otherObj = ulvi->getUMLObject(); + if (m_pObject == NULL || otherObj == NULL) return key( col, ascending ).compare( other->key( col, ascending) ); - + if (ourType == Uml::lvt_Attribute) { + UMLClass *ourParent = dynamic_cast<UMLClass*>(m_pObject->parent()); + UMLClass *otherParent = dynamic_cast<UMLClass*>(otherObj->parent()); + if (ourParent == NULL || otherParent == NULL || ourParent != otherParent) { + kdError() << "UMLListViewItem::compare(UMLAttribute): ourParent=" + << ourParent << ", otherParent=" << otherParent << endl; + return key( col, ascending ).compare( other->key( col, ascending) ); + } + UMLAttributeList atts = ourParent->getAttributeList(); + int myIndex = atts.findRef( static_cast<UMLAttribute*>(m_pObject) ); + int otherIndex = atts.findRef( static_cast<UMLAttribute*>(otherObj) ); + return (myIndex < otherIndex ? -1 : myIndex > otherIndex ? 1 : 0); + } else if (ourType == Uml::lvt_Operation) { + UMLClassifier *ourParent = dynamic_cast<UMLClassifier*>(m_pObject->parent()); + UMLClassifier *otherParent = dynamic_cast<UMLClassifier*>(otherObj->parent()); + if (ourParent == NULL || otherParent == NULL || ourParent != otherParent) { + kdError() << "UMLListViewItem::compare(UMLOperation): ourParent=" + << ourParent << ", otherParent=" << otherParent << endl; + return key( col, ascending ).compare( other->key( col, ascending) ); + } + UMLOperationList ops = ourParent->getOpList(); + int myIndex = ops.findRef( static_cast<UMLOperation*>(m_pObject) ); + int otherIndex = ops.findRef( static_cast<UMLOperation*>(otherObj) ); + return (myIndex < otherIndex ? -1 : myIndex > otherIndex ? 1 : 0); + } else { + return key( col, ascending ).compare( other->key( col, ascending) ); + } + } if ( ourType < otherType ) return -1; Please try again with cvs head, it works for me. |