Bug 414759 - Sequence diagram - on reload file - app crash when conditions are added
Summary: Sequence diagram - on reload file - app crash when conditions are added
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: 2.29.3 (KDE Applications 19.08.3)
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-12-02 17:28 UTC by Mario P.
Modified: 2019-12-03 17:32 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 2.30.0 (KDE Applications 19.12.0)
Sentry Crash Report:


Attachments
kcrash report (21.93 KB, text/plain)
2019-12-02 17:28 UTC, Mario P.
Details
detailed debug screenshot (248.08 KB, image/png)
2019-12-02 17:30 UTC, Mario P.
Details
test case (11.60 KB, application/x-uml)
2019-12-02 23:32 UTC, Ralf Habacker
Details
extented testcase for reproducing behaviour (24.89 KB, application/x-uml)
2019-12-03 06:23 UTC, Mario P.
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mario P. 2019-12-02 17:28:46 UTC
Created attachment 124274 [details]
kcrash report

SUMMARY

umbrello5 (2.29.3)

STEPS TO REPRODUCE
1. create a sequence diagram with various messages and conditions 
2. save it
3. restart app / re-open xmi-file

OBSERVED RESULT

crash

EXPECTED RESULT


SOFTWARE/OS VERSIONS
Windows: -
macOS: -
Linux/KDE Plasma: openSuSE TW 
(available in About System)
KDE Plasma Version: 5.17.3
KDE Frameworks Version: 5.64.0
Qt Version: 5.13.1

ADDITIONAL INFORMATION
Comment 1 Mario P. 2019-12-02 17:30:53 UTC
Created attachment 124275 [details]
detailed debug screenshot
Comment 2 Ralf Habacker 2019-12-02 23:32:12 UTC
Created attachment 124283 [details]
test case

Thanks for your bug report. With the attached test case I cannot reproduce this error, which leads me to assume that this error depends on the diagram content in the corresponding xmi file. 
It would be helpful to extend the test case to reproduce the error or get the original file that caused the crash.
Comment 3 Mario P. 2019-12-03 06:23:12 UTC
Created attachment 124288 [details]
extented testcase for reproducing behaviour

took a while in editing until the fault occurred again
Comment 4 Ralf Habacker 2019-12-03 10:11:03 UTC
Git commit 80a545dc20473065998746d64e07e79b3c45346e by Ralf Habacker.
Committed on 03/12/2019 at 10:10.
Pushed by habacker into branch 'release/19.12'.

Apply quick fix to prevent crashing on loading extented testcase for reproducing behaviour

Make sure that access to the object widget instance is always protected.
The reason why the linked object widget could not be found when loading
is unknown so far.

M  +22   -21   umbrello/umlwidgets/preconditionwidget.cpp

https://invent.kde.org/kde/umbrello/commit/80a545dc20473065998746d64e07e79b3c45346e
Comment 5 Ralf Habacker 2019-12-03 10:13:06 UTC
(In reply to Mario P. from comment #3)
> Created attachment 124288 [details]
> extented testcase for reproducing behaviour
> 
> took a while in editing until the fault occurred again

Thanks for providing this information, which helped to develop a quick fix. You may clone the umbrello git repo to build a binary including the fix.
Comment 6 Ralf Habacker 2019-12-03 11:08:39 UTC
Git commit ab3dd08138529eb9fe068463141bf02b1b3d5dd9 by Ralf Habacker.
Committed on 03/12/2019 at 10:33.
Pushed by habacker into branch 'release/19.12'.

Fix 'Sequence diagram - on reload file - app crash when conditions are added'

Cleanup activating of widget loaded from xmi file.
FIXED-IN:2.30.0 (KDE Applications 19.12.0)

M  +15   -33   umbrello/umlwidgets/preconditionwidget.cpp
M  +0    -1    umbrello/umlwidgets/preconditionwidget.h

https://invent.kde.org/kde/umbrello/commit/ab3dd08138529eb9fe068463141bf02b1b3d5dd9
Comment 7 Ralf Habacker 2019-12-03 11:08:39 UTC
Git commit b1e0cea4d27c0cd62e784dc00090e5b028711ff2 by Ralf Habacker.
Committed on 03/12/2019 at 11:03.
Pushed by habacker into branch 'release/19.12'.

Add save/load unit test for class PreConditionWidget

M  +10   -0    umbrello/umlwidgets/preconditionwidget.cpp
M  +2    -1    umbrello/umlwidgets/preconditionwidget.h
M  +7    -0    unittests/CMakeLists.txt
M  +44   -0    unittests/testbase.h
A  +49   -0    unittests/testpreconditionwidget.cpp     [License: GPL (v2/3)]
A  +33   -0    unittests/testpreconditionwidget.h     [License: GPL (v2/3)]

https://invent.kde.org/kde/umbrello/commit/b1e0cea4d27c0cd62e784dc00090e5b028711ff2
Comment 8 Mario P. 2019-12-03 17:32:58 UTC
great - appreciate your work!
Could get the cloned repo compiled - and now it simply does.
Thanks for the quick solution!