Bug 327910 - Crashes on copy and paste into new file (from list view)
Summary: Crashes on copy and paste into new file (from list view)
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: Git
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Joris Steyn
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-21 17:00 UTC by Joris Steyn
Modified: 2013-12-17 22:18 UTC (History)
1 user (show)

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 Joris Steyn 2013-11-21 17:00:06 UTC
One crash is similar to  bug 327834. Makes sense because that fix was only applied to clip4.

Goals for this ticket:
* fix specific crash due to missing associations
* see if fixes that recently went to Clip1 can also benefit Clip2
* see if it's possible to refactor UMLDragData so different clips can share more code paths (loading of UMLObjects, widgets and listviewitems)
* create new tickets for remaining issues, if any

Reproducible: Always

Steps to Reproduce:
1. Start Umbrello
2. Add two classes to the class diagram
3. Add an association between the two
4. Select the list view item of the class diagram in the tree view
5. CTRL+C
6. File -> New / New Umbrello instance
7. Select "Logical View" in the tree
8. CTRL+V (so far so good)
9. Interact with the widgets (move/...)


Actual Results:  
I have seen different crashes, the test XMI's from bug 327834 for example all behave differently (but crash when interacting with the widgets).
Comment 1 Ralf Habacker 2013-11-21 20:03:10 UTC
I found in the application debug messages: 

umbrello(21406): cannot find UMLObject  "jme6HVuGlz2n" 

this id belongs to the pasted association widget: 
    <assocwidget indexa="1" indexb="1" usesdiagramusefillcolor="0" widgetaid="OpRWHZhZOk2Q" usesdiagramfillcolor="64" fillcolor="none" linecolor="none" totalcounta="2" xmi.id="jme6HVuGlz2n" widgetbid="3MVrqyH7o2qd" totalcountb="2" type="512" textcolor="none" usefillcolor="1" linewidth="none">
     <linepath layout="Polyline">
      <startpoint startx="-551" starty="-548"/>
      <endpoint endx="-347" endy="-170"/>
     </linepath>
    </assocwidget>

The crash happens at 
0	WidgetBase::rect	widgetbase.cpp	590	0x62dd30	
1	UMLWidget::width	umlwidget.h	131	0x5def1f	
2	AssociationWidget::calculateTextPosition	associationwidget.cpp	2476	0x5f0212	
3	AssociationWidget::saveIdealTextPositions	associationwidget.cpp	1851	0x5f06fe	
4	UMLWidget::adjustAssocs	umlwidget.cpp	1023	0x625490	
5	UMLWidget::updateGeometry	umlwidget.cpp	1501	0x6230f2	
6	Uml::CmdMoveWidget::redo	cmd_moveWidget.cpp	41	0x5dea4a	
7	QUndoStack::push	qundostack.cpp	583	0x7ffff4ff2563	
8	UMLApp::executeCommand	uml.cpp	3031	0x67ef8e	
9	UMLWidget::mouseReleaseEvent	umlwidget.cpp	513	0x626500	
10	ToolBarState::mouseRelease	toolbarstate.cpp	121	0x678127	
11	QGraphicsScene::event	qgraphicsscene.cpp	3458	0x7ffff4f9e32c	
12	QApplicationPrivate::notify_helper	qapplication.cpp	4562	0x7ffff49a491c	
13	QApplication::notify	qapplication.cpp	4423	0x7ffff49a8d9a	
14	KApplication::notify	kapplication.cpp	311	0x7ffff6750e16	
15	QCoreApplication::notifyInternal	qcoreapplication.cpp	949	0x7ffff5817e7e	
16	QGraphicsView::mouseReleaseEvent	qgraphicsview.cpp	3338	0x7ffff4fb4631	
17	QWidget::event	qwidget.cpp	8376	0x7ffff49f43d9	
18	QFrame::event	qframe.cpp	557	0x7ffff4d9fa86	
19	QGraphicsView::viewportEvent	qgraphicsview.cpp	2866	0x7ffff4fb7aab	
20	QCoreApplicationPrivate::sendThroughObjectEventFilters	qcoreapplication.cpp	1059	0x7ffff5817fe6	
...	<Mehr>				

while accessing members of the AssociationWidget. The AssociationWidget seems not to be initialized corrected or been freed, see the m_Assocs member below:

		this	@0x121b250	ClassifierWidget
			[UMLWidget]		UMLWidget
				[WidgetBase]		WidgetBase
				DefaultMaximumSize	(1000.0, 5000.0)	QSizeF
				DefaultMinimumSize	(50.0, 20.0)	QSizeF
				m_Assocs	<ein Element>	AssociationWidgetList
					[0]	@0x121ba98	AssociationWidget
						[WidgetBase]		WidgetBase
						[LinkWidget]		LinkWidget
						m_activated	16	bool
						m_associationClass	@0x710000063f	ClassifierWidget
						m_associationLine	@0x7100000639	AssociationLine
						m_associationType	6 (6)	Uml::AssociationType::Enum
						m_eventScenePos	(0.0, nan)	QPointF
						m_nLinePathSegmentIndex	233	int
						m_nameWidget	@0x3520000058d	FloatingTextWidget
						m_oldChangeAPoint	(1.76125650765e-312, 2.29175546214e-312)	QPointF
						m_oldChangeBPoint	(2.31297541218e-312, 2.37663528698e-312)	QPointF
						m_oldMultiAPoint	(4.88059033142e-313, 1.10343781267e-312)	QPointF
						m_oldMultiBPoint	(4.88059033296e-313, 1.10343781282e-312)	QPointF
						m_oldNamePoint	(1.33685734831e-312, 2.12199580678e-314)	QPointF
						m_oldRoleAPoint	(2.3129754133e-312, 2.37663529378e-312)	QPointF
						m_oldRoleBPoint	(2.39785524382e-312, 2.39785524489e-312)	QPointF
						m_ordered	<nicht zugänglich>	QList<AssociationWidget*>
						m_pAssocClassLine	@0x71000000ef	QGraphicsLineItem
						m_pAssocClassLineSel0	@0x7100000103	QGraphicsRectItem
						m_pAssocClassLineSel1	@0x7100000274	QGraphicsRectItem
						m_positions	@0x1055130	double [100]
						m_positions_len	31	int
						m_role	@0x1055518	AssociationWidget::WidgetRole [2]
						m_selected	16	bool
						m_unNameLineSegment	0	int
						staticMetaObject	@0x73e7a0	QMetaObject
						staticMetaObjectExtraData	@0x73e7c0	QMetaObjectExtraData
Comment 2 Joris Steyn 2013-12-17 22:18:01 UTC
Git commit efd686cda1711f0b573f2251e2e7d66765b765ff by Joris Steyn.
Committed on 19/11/2013 at 21:53.
Pushed by jorissteyn into branch 'master'.

Refactor decoding of clip data

Decoding of UMLObjects now uses the same code path on all clips. Fixes that
recently went to clip1 are now also active for clip2 (diagrams). List view
items are never decoded, but created in response of a signal of new UMLObjects.

When pasting clip2 in the same file, only the diagram gets duplicated and not
all contained UMLObjects, like described in feature request 85807.
Related: bug 327670, bug 85807

M  +47   -135  umbrello/clipboard/umlclipboard.cpp
M  +0    -6    umbrello/clipboard/umlclipboard.h
M  +161  -221  umbrello/clipboard/umldragdata.cpp
M  +8    -9    umbrello/clipboard/umldragdata.h
M  +3    -5    umbrello/umldoc.cpp

http://commits.kde.org/umbrello/efd686cda1711f0b573f2251e2e7d66765b765ff