Bug 344975 - Crash on close of xmi file
Summary: Crash on close of xmi file
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: 2.15.80 (KDE Applications 15.03.80)
Platform: Other Linux
: NOR crash
Target Milestone: ---
Assignee: Umbrello Development Group
URL: https://bazaar.launchpad.net/~avaneya...
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-09 13:34 UTC by Ralf Habacker
Modified: 2015-04-17 21:04 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 2.15.90 (KDE Applications 15.03.90)
Sentry Crash Report:


Attachments
backtrace (12.06 KB, text/plain)
2015-03-09 13:34 UTC, Ralf Habacker
Details
backtrace from 2.15.3 (11.69 KB, text/plain)
2015-03-09 13:43 UTC, Ralf Habacker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Habacker 2015-03-09 13:34:26 UTC
umbrello crashes after unloading  the mentioned file.

Reproducible: Always

Steps to Reproduce:
1. start umbrello
2. open file from url
3. create a new document

Actual Results:  
umbrello crashes

Expected Results:  
umbrello should not crash
Comment 1 Ralf Habacker 2015-03-09 13:34:42 UTC
Created attachment 91506 [details]
backtrace
Comment 2 Ralf Habacker 2015-03-09 13:43:08 UTC
Created attachment 91507 [details]
backtrace from 2.15.3

version 2.15.3 is also affected. the crash happens on a slightly modified location. Common ancester with 2.15.80 is the call to qApp->processEvents() in UMLApp::setCurrentView()…
Comment 3 Ralf Habacker 2015-03-09 16:24:54 UTC
git bisect returned commit 69ec36139554f4b4c2fd4089beb4cb83c13efbbb a the commit which introduces the crash. 

After removing the call to createBirdView() from UMLApp::setCurrentView() the crash disappears.  From a first look it shows that because class BirdView adds an additional view for the current scene, that there might be a a problem in setCurrentView() and related methods with multiple views/scene combination. 

BirdView::BirdView(QDockWidget *parent, UMLView* view)
{
    // create view and add it to the container frame
    UMLScene* scene = m_view->umlScene();
    m_birdView = new QGraphicsView(scene); //A: , container);

The call stack shows, that in the error case there are multiple removeView... calls raised by a call to qApp->processEvents() in  UMLApp::setCurrentView()

After removing this call (without the above mentioned workaround)  the crash disappears. 

The call to processEvent() has been added in KDE 3.5 times as a hacky workaround.

commit 455fb83e413f0d8361d8c025a7fbc20ecf339807
Author: Oliver Kellogg <okellogg@users.sourceforge.net>
Date:   Fri Sep 22 06:23:00 2006 +0000

    setCurrentView(): Had to insert kapp->processEvents() because clicking
     on different diagrams in the list view was not working properly.
    (This is hacky. Perhaps somebody has a better idea?)
    
    svn path=/branches/KDE/3.5/kdesdk/umbrello/; revision=587279

Without this call clicking on different diagrams is not an issue anymore, so it looks anyway obsolate. Any comments ?
Comment 4 Oliver Kellogg 2015-03-09 18:58:12 UTC
(In reply to Ralf Habacker from comment #3)
> [...]
> Without this call clicking on different diagrams is not an issue anymore, so
> it looks anyway obsolete. Any comments ?

If diagram updating works without: All the better!
[ On the side, considering the lengthy backtrace I am amazed that it doesn't crash elsewhere after removal of the qApp->processEvents() ]
Comment 5 Ralf Habacker 2015-03-09 19:29:22 UTC
Git commit 7ac6297cfdfe4f183c0345ecab84fe432267e95a by Ralf Habacker.
Committed on 09/03/2015 at 19:24.
Pushed by habacker into branch 'Applications/15.04'.

Fix 'Crash on close of xmi file'.
FIXED-IN:2.15.90 (KDE 15.03.90)

M  +0    -1    umbrello/uml.cpp

http://commits.kde.org/umbrello/7ac6297cfdfe4f183c0345ecab84fe432267e95a
Comment 6 Ralf Habacker 2015-03-12 16:21:06 UTC
Git commit 70c1f1d3849720b719ffb197f0a0a8a5089f7bca by Ralf Habacker.
Committed on 12/03/2015 at 12:58.
Pushed by habacker into branch 'master'.

Add UMLScene::getBackgroundColor() as common method to fetch the current scene background color.

This patch helps to avoid a crash caused by UMLScene::activeView() returning zero, which happens
while tracking this bug.

M  +11   -0    umbrello/umlscene.cpp
M  +2    -0    umbrello/umlscene.h
M  +1    -1    umbrello/widgets/artifactwidget.cpp
M  +3    -3    umbrello/widgets/classifierwidget.cpp
M  +1    -1    umbrello/widgets/componentwidget.cpp
M  +1    -1    umbrello/widgets/datatypewidget.cpp
M  +1    -1    umbrello/widgets/entitywidget.cpp
M  +1    -1    umbrello/widgets/enumwidget.cpp
M  +1    -1    umbrello/widgets/nodewidget.cpp
M  +1    -1    umbrello/widgets/objectwidget.cpp
M  +1    -1    umbrello/widgets/packagewidget.cpp
M  +1    -1    umbrello/widgets/pinportbase.cpp

http://commits.kde.org/umbrello/70c1f1d3849720b719ffb197f0a0a8a5089f7bca
Comment 7 Ralf Habacker 2015-03-16 18:49:16 UTC
Git commit 4830d8b424b0630e5510b37629161009c5238f07 by Ralf Habacker.
Committed on 12/03/2015 at 12:58.
Pushed by habacker into branch 'Applications/15.04'.

Add UMLScene::getBackgroundColor() as common method to fetch the current scene background color.

This patch helps to avoid a crash caused by UMLScene::activeView() returning zero, which happens
while tracking this bug.

M  +11   -0    umbrello/umlscene.cpp
M  +2    -0    umbrello/umlscene.h
M  +1    -1    umbrello/widgets/artifactwidget.cpp
M  +3    -3    umbrello/widgets/classifierwidget.cpp
M  +1    -1    umbrello/widgets/componentwidget.cpp
M  +1    -1    umbrello/widgets/datatypewidget.cpp
M  +1    -1    umbrello/widgets/entitywidget.cpp
M  +1    -1    umbrello/widgets/enumwidget.cpp
M  +1    -1    umbrello/widgets/nodewidget.cpp
M  +1    -1    umbrello/widgets/objectwidget.cpp
M  +1    -1    umbrello/widgets/packagewidget.cpp
M  +1    -1    umbrello/widgets/pinportbase.cpp

http://commits.kde.org/umbrello/4830d8b424b0630e5510b37629161009c5238f07