Bug 65312 - crash on deleting an attribute from properties dialog attribute page
Summary: crash on deleting an attribute from properties dialog attribute page
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: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-10-01 14:26 UTC by John Ratke
Modified: 2003-10-02 12:21 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Ratke 2003-10-01 14:26:56 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
Compiler:          gcc (GCC) 3.2.2 (Mandrake Linux 9.1 3.2.2-3mdk) 
OS:          Linux

I have a class with two attributes and an operation.   This class is part of a class diagram.   If I right click on the class in the diagram and open the properties dialog, click on the attributes page, select the second attribute, and click on the delete button, the following crash occurs.    This also happens if I do this by entering the properties dialog by right clicking on the class in the list view.

[New Thread 16384 (LWP 2464)]
0x4120a677 in waitpid () from /lib/i686/libpthread.so.0
#0  0x4120a677 in waitpid () from /lib/i686/libpthread.so.0
#1  0x40882a87 in KCrash::defaultCrashHandler(int) (sig=11) at kcrash.cpp:242
#2  0x412095ce in __pthread_sighandler () from /lib/i686/libpthread.so.0
#3  0x413763b8 in __libc_sigaction () from /lib/i686/libc.so.6
#4  0x40eacf28 in QString::operator=(QString const&) ()
   from /build/kde/qt-copy/lib/libqt-mt.so.3
#5  0x0815abb7 in UMLObject::setDoc(QString) (this=0x8434f80)
    at umlobject.cpp:150
#6  0x081f1134 in ClassifierListPage::slotClicked(QListBoxItem*) (
    this=0x84ed448, item=0x0) at classifierlistpage.cpp:159
#7  0x081f1f73 in ClassifierListPage::slotDelete() (this=0x84ed448)
    at classifierlistpage.cpp:346
#8  0x081f2368 in ClassifierListPage::qt_invoke(int, QUObject*) (
    this=0x84ed448, _id=55, _o=0xbfffde90) at classifierlistpage.moc:149
#9  0x40c2b9c7 in QObject::activate_signal(QConnectionList*, QUObject*) ()
   from /build/kde/qt-copy/lib/libqt-mt.so.3
#10 0x40c2b80c in QObject::activate_signal(int) ()
   from /build/kde/qt-copy/lib/libqt-mt.so.3
#11 0x40f0e5a8 in QButton::clicked() ()
   from /build/kde/qt-copy/lib/libqt-mt.so.3
#12 0x40caff8b in QButton::mouseReleaseEvent(QMouseEvent*) ()
   from /build/kde/qt-copy/lib/libqt-mt.so.3
#13 0x40c5bfa4 in QWidget::event(QEvent*) ()
   from /build/kde/qt-copy/lib/libqt-mt.so.3
#14 0x40bd52d4 in QApplication::internalNotify(QObject*, QEvent*) ()
   from /build/kde/qt-copy/lib/libqt-mt.so.3
#15 0x40bd4a95 in QApplication::notify(QObject*, QEvent*) ()
   from /build/kde/qt-copy/lib/libqt-mt.so.3
#16 0x407e6f36 in KApplication::notify(QObject*, QEvent*) (this=0xbffff300, 
    receiver=0x84e6010, event=0xbfffe250) at kapplication.cpp:492
#17 0x40b74ba1 in QETWidget::translateMouseEvent(_XEvent const*) ()
   from /build/kde/qt-copy/lib/libqt-mt.so.3
#18 0x40b72571 in QApplication::x11ProcessEvent(_XEvent*) ()
   from /build/kde/qt-copy/lib/libqt-mt.so.3
#19 0x40b87758 in QEventLoop::processEvents(unsigned) ()
   from /build/kde/qt-copy/lib/libqt-mt.so.3
#20 0x40be6e9f in QEventLoop::enterLoop() ()
   from /build/kde/qt-copy/lib/libqt-mt.so.3
#21 0x40bd5570 in QApplication::enter_loop() ()
   from /build/kde/qt-copy/lib/libqt-mt.so.3
#22 0x40d90946 in QDialog::exec() () from /build/kde/qt-copy/lib/libqt-mt.so.3
#23 0x08147c23 in UMLDoc::showProperties(UMLObject*, int, bool) (
    this=0x8382790, object=0x8434960, page=0, assoc=false) at umldoc.cpp:1149
#24 0x08150392 in UMLListView::popupMenuSel(int) (this=0x8375898, sel=1965)
    at umllistview.cpp:307
#25 0x08156a7a in UMLListView::qt_invoke(int, QUObject*) (this=0x8375898, 
    _id=114, _o=0xbfffe9b0) at /build/kde/qt-copy/include/private/qucom_p.h:388
#26 0x40c2b9c7 in QObject::activate_signal(QConnectionList*, QUObject*) ()
   from /build/kde/qt-copy/lib/libqt-mt.so.3
#27 0x40c2bb08 in QObject::activate_signal(int, int) ()
   from /build/kde/qt-copy/lib/libqt-mt.so.3
#28 0x40f1afd8 in QPopupMenu::activated(int) ()
   from /build/kde/qt-copy/lib/libqt-mt.so.3
#29 0x40d1824a in QPopupMenu::actSig(int, bool) ()
   from /build/kde/qt-copy/lib/libqt-mt.so.3
#30 0x40d1c31d in QPopupMenu::mouseReleaseEvent(QMouseEvent*) ()
   from /build/kde/qt-copy/lib/libqt-mt.so.3
#31 0x40c5bfa4 in QWidget::event(QEvent*) ()
   from /build/kde/qt-copy/lib/libqt-mt.so.3
#32 0x40bd52d4 in QApplication::internalNotify(QObject*, QEvent*) ()
   from /build/kde/qt-copy/lib/libqt-mt.so.3
#33 0x40bd4a95 in QApplication::notify(QObject*, QEvent*) ()
   from /build/kde/qt-copy/lib/libqt-mt.so.3
#34 0x407e6f36 in KApplication::notify(QObject*, QEvent*) (this=0xbffff300, 
    receiver=0x8493e58, event=0xbfffee90) at kapplication.cpp:492
#35 0x40b74718 in QETWidget::translateMouseEvent(_XEvent const*) ()
   from /build/kde/qt-copy/lib/libqt-mt.so.3
#36 0x40b72571 in QApplication::x11ProcessEvent(_XEvent*) ()
   from /build/kde/qt-copy/lib/libqt-mt.so.3
#37 0x40b87758 in QEventLoop::processEvents(unsigned) ()
   from /build/kde/qt-copy/lib/libqt-mt.so.3
#38 0x40be6e9f in QEventLoop::enterLoop() ()
   from /build/kde/qt-copy/lib/libqt-mt.so.3
#39 0x40be6d54 in QEventLoop::exec() ()
   from /build/kde/qt-copy/lib/libqt-mt.so.3
#40 0x40bd5510 in QApplication::exec() ()
   from /build/kde/qt-copy/lib/libqt-mt.so.3
#41 0x0812201f in main (argc=1, argv=0xbffff474) at main.cpp:86
#42 0x413637f7 in __libc_start_main () from /lib/i686/libc.so.6
Comment 1 John Ratke 2003-10-02 03:17:01 UTC
I looked at this closer and the problem is with m_pOldListItem, which appears to be 
used only to set the documentation on the previous item when changing items.  
When the delete happens, the item is removed from UMLDoc's objectList, so it is 
deleted. but m_pOldListItem still points to the memory so when slotClicked(0) is 
called it tries to setDoc on the deleted item. 
 
I will attach a proposed patch to set m_pOldListItem to 0 in slotDelete.  This fix 
works for me.  
 
Comment 2 John Ratke 2003-10-02 03:19:24 UTC
Here is the proposed patch: 
 
Index: classifierlistpage.cpp 
=================================================================== 
RCS file: /home/kde/kdesdk/umbrello/umbrello/dialogs/classifierlistpage.cpp,v 
retrieving revision 1.4 
diff -u -3 -p -r1.4 classifierlistpage.cpp 
--- classifierlistpage.cpp      1 Oct 2003 03:07:08 -0000       1.4 
+++ classifierlistpage.cpp      2 Oct 2003 01:09:42 -0000 
@@ -346,6 +346,7 @@ void ClassifierListPage::slotDelete() { 
        //but really shouldn't matter 
        m_pDoc->removeUMLObject(selectedAttribute); 
        m_pItemListLB->removeItem( m_pItemListLB->currentItem()); 
+       m_pOldListItem = 0; 
        slotClicked(0); 
 } 
 
Comment 3 Sebastian Stein 2003-10-02 12:21:56 UTC
fixed by John Ratke