Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 409963 - Close All Diagrams In Model => Workspace Crash
Summary: Close All Diagrams In Model => Workspace Crash
Status: CLOSED FIXED
Alias: None
Product: Papyrus
Classification: Modeling
Component: Core (show other bugs)
Version: 1.0.0   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: 1.0.0   Edit
Assignee: Camille Letavernier CLA
QA Contact:
URL:
Whiteboard: dx stable deploy
Keywords:
Depends on: 342711
Blocks:
  Show dependency tree
 
Reported: 2013-06-05 10:01 EDT by Toni Siljamäki CLA
Modified: 2015-04-10 05:53 EDT (History)
4 users (show)

See Also:


Attachments
Crash message screenshot (15.40 KB, image/gif)
2013-06-05 10:01 EDT, Toni Siljamäki CLA
no flags Details
The error log. (46.32 KB, application/octet-stream)
2013-06-05 10:02 EDT, Toni Siljamäki CLA
no flags Details
Screenshot of startup problems after deleting the .snap file (30.31 KB, image/gif)
2013-06-05 17:37 EDT, Toni Siljamäki CLA
no flags Details
Workspace crashing during launch. (4.65 MB, application/octet-stream)
2013-06-07 05:49 EDT, Toni Siljamäki CLA
no flags Details
Same workspace, but which opens OK. (2.79 MB, application/octet-stream)
2013-06-07 05:56 EDT, Toni Siljamäki CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Toni Siljamäki CLA 2013-06-05 10:01:55 EDT
Created attachment 231990 [details]
Crash message screenshot

This error has happened a couple of times before quite recently.
This is a stability issue.

1) I closed all diagrams in a model and saved it.
2) I shutdown Eclipse/Papyrus.
3) I lauched the workspace again = Crash.

Attached is the pop-up crash message and the error log.

Importing the project containing the model for which I closed
all diagrams into a new workspace and it all works fine.
Making a diff between the original and imported project and
all its files shows that they are exactly the same.

This tells me that there is something wrong in the .metadata folder.

Trying to open the original workspace and it crashes every time,
and there is a LOT of projects in that ws, but I worked on only one of them.

I am pretty sure that closing all diagrams was exactly what I did
when I got this crash the last time, while working on the same model.
(the one attached to Bug 409573, but the original one)

I have saved this workspace to that you can ask questions about it after
studying the error log and ask for additional files to attach to this report.

Having to re-create the ws yet another time feels quite annoying.
I liked to "repair" the ws myself but I have no idea what to look for.
Comment 1 Toni Siljamäki CLA 2013-06-05 10:02:45 EDT
Created attachment 231991 [details]
The error log.
Comment 2 Remi Schnekenburger CLA 2013-06-05 10:36:29 EDT
Hi Toni,

It seems that this problem comes from a problem during Eclipse plartform shutdown. I found many logs similar on the web from Eclipse users. One solution was the following:
- close all running processes concerning Eclipse
- remove the following file : YOUR_WORKSPACE/.metadata/.plugins/org.eclipse.core.resources/.snap
- restart Eclipse

Could you try on your crashed workspace?
Comment 3 Toni Siljamäki CLA 2013-06-05 17:37:41 EDT
Created attachment 232017 [details]
Screenshot of startup problems after deleting the .snap file

Hi Remi.
Deleting the .snap file feels a bit like taking an aspirin instead of
going to the choripractor. (= it appears to solve the problem short term)

The attached screenshot appeared after deleting the .snap file and then
re-launching the workspace, where the details shows a number of
java.lang.NullPointerException messages.

No like/time investigating what they mean.

I have prepared a stripped ws to send for testing shortly.
/Toni
Comment 4 Toni Siljamäki CLA 2013-06-07 05:49:14 EDT
Created attachment 232088 [details]
Workspace crashing during launch.

Here is a copy of the workspace I was working on.

I have used a "parallel" workspace do delete all contents in the projects
of this workspace (from the side, so to speak), except for the project
TEST_PuschActivator_5_dragAndDropActivity, in which I instead replaced
the content with the content from the project attached to Bug 409573.

When unzipping this ws it will crash during launch.
Launching the ws agan and it will open OK.

My original ws however crashes every time, simply refuring to be opened.
Comment 5 Toni Siljamäki CLA 2013-06-07 05:56:44 EDT
Created attachment 232089 [details]
Same workspace, but which opens OK.

...simply refusing to be opened. (from previous comment)

This is the same workspace after it has been opened twice,
and opened OK the second time.

You can use this one to make diff's, if you need.

I googled a bit on .snap files and they appear to be crash recovery files,
so something made my Eclipse crash, at least made it believe that it did.

The only thing I did, and also the last time, was to work on the problematic
Papyrus model, close all diagrams in the model and then shut down Papyrus.

I have also seen some google info that crashes can be caused by stack overflow,
and I will soon submit another bug related to memory leaks in Papyrus.

Perhaps the crash-type-problem get solved when solving those memory leaks.
Comment 6 Camille Letavernier CLA 2013-06-13 04:44:00 EDT
The SysML IBD (And maybe others) initializes preferences in its Activator#start. At some point, this initialization tries to access the current Display, which may not yet be initialized. In this case, the initialization of the JFace class PreferenceConverter fails (Because it tries to access the default display statically, during the class loading), resulting in all these "NoClassDefFoundError".

Preferences should not be initialized in the Activator.
Comment 7 Camille Letavernier CLA 2013-12-18 09:11:13 EST
Actually, the error comes from JFace, as described in Bug 342711
Comment 8 Christian Damus CLA 2014-11-12 16:03:27 EST
Is this bug still a problem?  From what I can tell of the discussion on bug 342711 (in particular, bug 342711 comment 11), Papyrus has already worked around the JFace bug that causes the current (Papyrus) bug.
Comment 9 Camille Letavernier CLA 2014-11-13 04:24:27 EST
> Is this bug still a problem? From what I can tell of the discussion on bug 342711 (in particular, bug 342711 comment 11), Papyrus has already worked around the JFace bug that causes the current (Papyrus) bug.

The bug has been worked around in the "Infra" preference pages, but basically, any class referencing the PreferenceConverter outside the UI Thread can cause this issue. The bug is difficult to reproduce, but I think one of the triggers was the Properties View loader, which is now executed from a background job, in the Properties View Activator. Loading the properties view configuration can lead to activating some plug-ins (contributing to the properties view, and their dependencies). So, we ended up with Activators being started in a Worker thread. If this Activator initializes its preferences (and "touches" PreferenceConverter), then potentially we have an InvalidThreadAccess.

The bug can be locally worked around, but I'm pretty sure there is no long term solution (Other than deprecating PreferenceConverter#FONTDATA_DEFAULT_DEFAULT and removing the static initialization in this class). So, only JFace can properly fix this bug.

Since the PreferenceConverter static initialization can only be done once, if any plug-in loads it from the UI Thread *before* we try to access it from a worker thread, the bug can't be reproduced. So... It's hard to tell whether we're safe now or not.

Finally, the fact that we removed most of the Preference Pages in diagrams suggests that we probably don't have any remaining reference to PreferenceConverter in the static initialization. But it's hard to be certain.
Comment 10 Toni Siljamäki CLA 2015-04-10 05:53:29 EDT
I close this old issue.