Bug 174397 - Going back in Command History after deleting a datatype causes crash
Summary: Going back in Command History after deleting a datatype causes crash
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Microsoft Windows Microsoft Windows
: NOR crash
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
: 244440 262079 268535 279382 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-11-06 01:14 UTC by Harrison A Neal
Modified: 2014-01-04 11:16 UTC (History)
9 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.13.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Harrison A Neal 2008-11-06 01:14:00 UTC
Version:           2.1.2 (using KDE 4.1.2)
OS:                MS Windows
Installed from:    MS Windows

By placing a datatype in a blank diagram (either dragging a predefined one or creating a new one), resizing or moving the datatype in the diagram, deleting the datatype in the diagram, and finally choosing to return to the "empty" position in the command history, a Just-In-Time debugger prompt appears.

Steps to reproduce:
1. Install KDE with the KDE for Windows Installer.
2. Open Umbrello.
3. Click the button labeled "Datatype" in the "Diagram Toolbar".
4. Click somewhere in the diagram.
5. Accept the default name.
6. Click the button labeled "Select" in the "Diagram Toolbar".
7. Move the datatype in the diagram.
8. Delete the datatype in the diagram.
9. In the Command History, click the entry labeled "<empty>".
Comment 1 Eduard Sukharev 2008-11-08 10:51:05 UTC
I can confirm this with Windows XP SP3, MSVC build.
Comment 2 Harrison A Neal 2008-11-24 17:09:00 UTC
 	00000000()	
>	umbrello.exe!UMLWidgetController::insertSaveValues(int _oldX=440, int _oldY=420, int X=274, int Y=320)  Line 400 + 0x19 bytes	C++
 	umbrello.exe!Uml::CmdMoveWidget::undo()  Line 66	C++
 	QtGuid4.dll!QUndoStack::setIndex(int idx=0)  Line 738 + 0x2a bytes	C++
 	QtGuid4.dll!QUndoModel::setStackCurrentIndex(const QModelIndex & index={...})  Line 157	C++
 	QtGuid4.dll!QUndoModel::qt_metacall(QMetaObject::Call _c=InvokeMetaMethod, int _id=3, void * * _a=0x0135b7e8)  Line 74	C++
 	QtCored4.dll!QMetaObject::activate(QObject * sender=0x042bc010, int from_signal_index=5, int to_signal_index=5, void * * argv=0x0135b7e8)  Line 3031 + 0x2b bytes	C++
 	QtCored4.dll!QMetaObject::activate(QObject * sender=0x042bc010, const QMetaObject * m=0x65a8ea88, int local_signal_index=1, void * * argv=0x0135b7e8)  Line 3101 + 0x15 bytes	C++
 	QtGuid4.dll!QItemSelectionModel::currentChanged(const QModelIndex & _t1={...}, const QModelIndex & _t2={...})  Line 151 + 0x15 bytes	C++
 	QtGuid4.dll!QItemSelectionModel::setCurrentIndex(const QModelIndex & index={...}, QFlags<enum QItemSelectionModel::SelectionFlag> command={...})  Line 1084	C++
 	QtGuid4.dll!QAbstractItemView::mousePressEvent(QMouseEvent * event=0x0135c2c8)  Line 1471	C++
 	QtGuid4.dll!QWidget::event(QEvent * event=0x0135c2c8)  Line 7160	C++
 	QtGuid4.dll!QFrame::event(QEvent * e=0x0135c2c8)  Line 652	C++
 	QtGuid4.dll!QAbstractScrollArea::viewportEvent(QEvent * e=0x0135c2c8)  Line 943 + 0xc bytes	C++
 	QtGuid4.dll!QAbstractItemView::viewportEvent(QEvent * event=0x0135c2c8)  Line 1430	C++
 	QtGuid4.dll!QAbstractScrollAreaPrivate::viewportEvent(QEvent * event=0x0135c2c8)  Line 96 + 0x28 bytes	C++
 	QtGuid4.dll!QAbstractScrollAreaFilter::eventFilter(QObject * o=0x042a0218, QEvent * e=0x0135c2c8)  Line 107 + 0x29 bytes	C++
 	QtCored4.dll!QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject * receiver=0x042a0218, QEvent * event=0x0135c2c8)  Line 694 + 0x15 bytes	C++
 	QtGuid4.dll!QApplicationPrivate::notify_helper(QObject * receiver=0x042a0218, QEvent * e=0x0135c2c8)  Line 3799 + 0x11 bytes	C++
 	QtGuid4.dll!QApplication::notify(QObject * receiver=0x042a0218, QEvent * e=0x0135c2c8)  Line 3528 + 0x2f bytes	C++
 	kdeui.dll!KApplication::notify(QObject * receiver=0x042a0218, QEvent * event=0x0135c2c8)  Line 311 + 0x13 bytes	C++
 	QtCored4.dll!QCoreApplication::notifyInternal(QObject * receiver=0x042a0218, QEvent * event=0x0135c2c8)  Line 587 + 0x15 bytes	C++
 	QtCored4.dll!QCoreApplication::sendSpontaneousEvent(QObject * receiver=0x042a0218, QEvent * event=0x0135c2c8)  Line 212 + 0x38 bytes	C++
 	QtGuid4.dll!QApplicationPrivate::sendMouseEvent(QWidget * receiver=0x042a0218, QMouseEvent * event=0x0135c2c8, QWidget * alienWidget=0x042a0218, QWidget * nativeWidget=0x03098d70, QWidget * * buttonDown=0x65a8d76c, QPointer<QWidget> & lastMouseReceiver={...})  Line 2793 + 0xe bytes	C++
 	QtGuid4.dll!QETWidget::translateMouseEvent(const tagMSG & msg={...})  Line 3085 + 0x28 bytes	C++
 	QtGuid4.dll!QtWndProc(HWND__ * hwnd=0x003f0380, unsigned int message=513, unsigned int wParam=1, long lParam=33423442)  Line 1543 + 0xc bytes	C++
 	user32.dll!7e418734() 	
 	[Frames below may be incorrect and/or missing, no symbols loaded for user32.dll]	
 	user32.dll!7e418816() 	
 	user32.dll!7e4189cd() 	
 	user32.dll!7e418a10() 	
 	QtCored4.dll!QEventDispatcherWin32::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags={...})  Line 737 + 0x21 bytes	C++
 	QtGuid4.dll!QGuiEventDispatcherWin32::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags={...})  Line 1084 + 0x15 bytes	C++
 	QtCored4.dll!QEventLoop::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags={...})  Line 144	C++
 	QtCored4.dll!QEventLoop::exec(QFlags<enum QEventLoop::ProcessEventsFlag> flags={...})  Line 194 + 0x1c bytes	C++
 	QtCored4.dll!QCoreApplication::exec()  Line 845 + 0x15 bytes	C++
 	QtGuid4.dll!QApplication::exec()  Line 3332	C++
 	umbrello.exe!main(int argc=1, char * * argv=0x02f6d3d0)  Line 110 + 0x8 bytes	C++
 	umbrello.exe!WinMain(HINSTANCE__ * instance=0x00400000, HINSTANCE__ * prevInstance=0x00000000, char * __formal=0x00052300, int cmdShow=10)  Line 134 + 0x12 bytes	C++
 	umbrello.exe!__tmainCRTStartup()  Line 574 + 0x35 bytes	C
 	umbrello.exe!WinMainCRTStartup()  Line 399	C
 	kernel32.dll!7c817067() 	
Comment 3 FiNeX 2009-08-04 01:03:10 UTC
bug #202436 could be related to this.
Comment 4 Nicolas L. 2010-07-13 12:38:58 UTC
*** Bug 244440 has been marked as a duplicate of this bug. ***
Comment 5 Christoph Feck 2011-08-04 21:53:33 UTC
*** Bug 268535 has been marked as a duplicate of this bug. ***
Comment 6 Christoph Feck 2011-08-04 21:55:24 UTC
*** Bug 262079 has been marked as a duplicate of this bug. ***
Comment 7 Christoph Feck 2011-08-04 21:56:11 UTC
*** Bug 279382 has been marked as a duplicate of this bug. ***
Comment 8 Ralf Habacker 2011-11-30 15:59:18 UTC
As far as i can see yet is the problem that in 

void UMLWidgetController::insertSaveValues(int _oldX, int _oldY, int X, int Y)
{
    m_widget->setX(X);
    m_widget->setY(Y);
    m_oldX = _oldX;
    m_oldY = _oldY;
}

the m_widget member points to non accessable memory.
Comment 9 Ralf Habacker 2011-12-01 07:23:22 UTC
The problem is that the related widget point to by m_widget has been destroyed. 

A breakpoint in UMLWidget destructor shows that the object has been deleted by a DeferedDelete event probably initiated by a call to deleteLater(). 

deleteLater() is used in 

void UMLView::removeWidget(UMLWidget * o)

and 

void UMLPackage::removeAllObjects().

probably initiated by the following method. 

    // Suppress the UMLObject
    void CmdCreateUMLObject::undo()
    {
        UMLDoc *doc = UMLApp::app()->document();
        doc->removeUMLObject(m_obj);
    }

m_obj is a reference to the real UMLObject, see 

    CmdCreateUMLObject::CmdCreateUMLObject(UMLObject* o)
      : m_obj(o)

so when the the real object is destroyed, the reference points to nomansland. 

No idea yet how to solve this problem.
Comment 10 Ralf Habacker 2013-09-02 13:50:55 UTC
confirmed on linux using git master