Bug 495664

Summary: Potential deadlock on representation creation if auto-save is enabled
Product: [Modeling] Sirius Reporter: Pierre-Charles David <pierre-charles.david>
Component: CoreAssignee: Project inbox <sirius.core-inbox>
Status: NEW --- QA Contact:
Severity: major    
Priority: P3 CC: maxime.porhel
Version: unspecifiedKeywords: triaged
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Sample project
none
The JVM stack during the deadlock
none
Screenshot none

Description Pierre-Charles David CLA 2016-06-08 05:44:13 EDT
Steps to reproduce, using a Neon-based package (which introduces auto-save via bug #34076):

1. Enable auto-save in the preferences (General > Editors > Auto-save), with a small delay (5s) for easier testing.
2. Create a modeling project with an ecore model and Ecore Tool's 'Design' viewpoint.
3. Create a class diagram on the root package of the ecore, and create a sub-package inside it, say 'P1'. Save.
4. Select the diagram in the model explorer, extract it into a separate aird, for example fragment.aird.
5. Open the ecore using the EMF tree editor, and in the properties view, rename 'P1' into 'P2' in the properties view. DO NOT SAVE THE CHANGE.
6. In the model explorer, select P1 and right click, create reprentation. When the popup asking for the representation title appears, hit enter. A second dialog will appear, asking in which aird to store the new representation. Wait.
7. After 5s, auto-save is triggered in the EMF tree editor => deadlock. No solution except killing the whole Java process.
Comment 1 Pierre-Charles David CLA 2016-06-08 05:52:33 EDT
Created attachment 262302 [details]
Sample project

Sample project corresponding to step 4 above. Import it, open the existing diagram, and go directly to step 5.
Comment 2 Pierre-Charles David CLA 2016-06-08 05:53:31 EDT
Created attachment 262303 [details]
The JVM stack during the deadlock
Comment 3 Pierre-Charles David CLA 2016-06-08 05:55:22 EDT
Created attachment 262304 [details]
Screenshot

Screenshot of how it looks once the deadlock happens. Note that the "OK" button in the "Analysis selection" dialog looks like it would be clickable (the buttons on the other dialogs are disabled), but it does not actually respond to mouse clicks.
Comment 4 Pierre-Charles David CLA 2016-06-08 06:09:52 EDT
See bug #486644 for details about the auto-save behavior in Neon, instead of the original #34076 whose scope was too broad and vague.