[Uml-devel] Infinite loop in UMLWidget::operator==

David Faure faure at kde.org
Wed Sep 24 11:37:04 UTC 2003


Fun :)

#12 0x08163b23 in UMLWidget::operator==(UMLWidget const&) (this=0x8476250, other=@0x84755d0)
    at /mnt/devel/kde/kdecvs/kdesdk/umbrello/umbrello/umlwidget.cpp:169
#13 0x080d412f in AssociationWidget::operator==(AssociationWidget&) (this=0x8475b60, Other=@0x8474ae8)
    at /mnt/devel/kde/kdecvs/kdesdk/umbrello/umbrello/associationwidget.cpp:171
#14 0x08163b23 in UMLWidget::operator==(UMLWidget const&) (this=0x8476250, other=@0x84755d0)
    at /mnt/devel/kde/kdecvs/kdesdk/umbrello/umbrello/umlwidget.cpp:169
#15 0x080d412f in AssociationWidget::operator==(AssociationWidget&) (this=0x8475b60, Other=@0x8474ae8)
    at /mnt/devel/kde/kdecvs/kdesdk/umbrello/umbrello/associationwidget.cpp:171
#16 0x08163b23 in UMLWidget::operator==(UMLWidget const&) (this=0x8476250, other=@0x84755d0)
    at /mnt/devel/kde/kdecvs/kdesdk/umbrello/umbrello/umlwidget.cpp:169
#17 0x080d412f in AssociationWidget::operator==(AssociationWidget&) (this=0x8475b60, Other=@0x8474ae8)
    at /mnt/devel/kde/kdecvs/kdesdk/umbrello/umbrello/associationwidget.cpp:171
#18 0x08163b23 in UMLWidget::operator==(UMLWidget const&) (this=0x8476250, other=@0x84755d0)
    at /mnt/devel/kde/kdecvs/kdesdk/umbrello/umbrello/umlwidget.cpp:169
#19 0x080d412f in AssociationWidget::operator==(AssociationWidget&) (this=0x8475b60, Other=@0x8474ae8)
    at /mnt/devel/kde/kdecvs/kdesdk/umbrello/umbrello/associationwidget.cpp:171
#20 0x08163b23 in UMLWidget::operator==(UMLWidget const&) (this=0x8476250, other=@0x84755d0)
    at /mnt/devel/kde/kdecvs/kdesdk/umbrello/umbrello/umlwidget.cpp:169
#21 0x080d412f in AssociationWidget::operator==(AssociationWidget&) (this=0x8475b60, Other=@0x8474ae8)
    at /mnt/devel/kde/kdecvs/kdesdk/umbrello/umbrello/associationwidget.cpp:171

The exact lines are:

#19 0x080d412f in AssociationWidget::operator==(AssociationWidget&) (this=0x8475b60, Other=@0x8474ae8)
    at /mnt/devel/kde/kdecvs/kdesdk/umbrello/umbrello/associationwidget.cpp:171
171             } else if ( !(*m_pName == *(Other.m_pName)) )

#18 0x08163b23 in UMLWidget::operator==(UMLWidget const&) (this=0x8476250, other=@0x84755d0)
    at /mnt/devel/kde/kdecvs/kdesdk/umbrello/umbrello/umlwidget.cpp:169
169                     if(!(*assoc == *assoc2)) {

That one is inside a loop that looks at all associations. This feels wrong to me.
If you imagine your classes like a tree, equality comparison should only
go "down" the tree, never up. Here it looks like it goes down in AssociationWidget,
but it goes up in UMLWidget, so it loops forever, going from one to the other.

(To reproduce: well, I'm simply loading a .xmi file with a collaboration diagram in it,
it crashes before anything appears)

-- 
David FAURE, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).




More information about the umbrello-devel mailing list