Bug #63841 Workbench crashes on opening existing EER model after file open failure
Submitted: 22 Dec 2011 15:15 Modified: 2 Feb 2012 21:17
Reporter: Stevo Slavic Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: Modeling Severity:S3 (Non-critical)
Version:5.2.36, 5.2.37 OS:Windows
Assigned to: CPU Architecture:Any

[22 Dec 2011 15:15] Stevo Slavic
Description:
Workbench crashes on opening existing EER model after file open failure.

How to repeat:
Steps to reproduce are:

1) Create EER model using MySQL Workbench 5.2.36 CE
2) Save EER model
3) Close MySQL Workbench
4) Attempt to open .ldb file of the created EER model using MySQL Workbench
   - MySQL Workbench will report error "Cannot open document", "The file is not a workbench document"
5) Click on close button of the error window
6) Double click on the created EER model in the list of existing EER models to open it
7) MySQL Workbench displays a dialog window: "Opening another model will close the currently open model. Do you wish to proceed opening it?"
8) Choose "Open" in the dialog
9) MySQL Workbench crashes.

Another one I've found while documenting this manifest while at step 4, and file open error window is displayed, switching focus away from MySQL Workbench to e.g. browser and then back to MySQL Workbench will put file open error window in the background of another modal window with notification that opening is in progress and it will overlap file open error window making it impossible to click close button on file open error window  - one can press enter to activate close button and get out of the situation.

Suggested fix:
Cleanup resources on failed open file attempt so that MySQL Workbench is in consistent state and can open existing EER models.

Also fix modal windows order when application receives focus again.
[22 Dec 2011 19:03] Valeriy Kravchuk
Looks related to bug #62589 (crash part).
[26 Dec 2011 10:35] MySQL Verification Team
Are you able to provide the stack trace?. Thanks.
[26 Dec 2011 10:55] Stevo Slavic
How do I do that? Does MySQL Workbench have some log files? I couldn't find one.

It's extremely easy to reproduce this issue. Just try opening any non-MySQL Workbench file using MySQL Workbench. It will try to open that file, report that it can not. And then in same MySQL Workbench session try opening a valid MySQL Workbench model from the list of existing previously known MySQL Workbench models. MySQL Workbench will report that "Opening another model will close the currently open model." and confirming here will crash MySQL Workbench.

Problem is, that opening invalid non-MySQL Workbench files seems to leave MySQL Workbench in invalid state (state where operation for opening model thinks there is a model already open), so if after that one tries to open valid model file, MySQL Workbench will report that there is model open and ask for confirmation to close it, and once confirmed MySQL Workbench will crash, probably when trying to close something that is not open, or pointing to invalid resource.

Please fix handling of opening non-MySQL Workbench files not to make/leave MySQL Workbench in invalid state, so that regular MySQL Workbench files can be opened afterwards without restarting MySQL Workbench.
[27 Dec 2011 10:32] Valeriy Kravchuk
Verified just as described in your last comment with recent 5.2.37 on Windows XP.
[2 Feb 2012 21:17] Philip Olson
Fixed as of 5.2.38:

Workbench would crash while opening an existing EER model,
after a file failed to open.