Bug 499084 - Eclipse hang saving workspace - workbench state on exit
Summary: Eclipse hang saving workspace - workbench state on exit
Status: CLOSED MOVED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 major with 6 votes (vote)
Target Milestone: ---   Edit
Assignee: Mylyn Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2016-08-03 03:48 EDT by Johan Burstedt CLA
Modified: 2018-07-10 10:08 EDT (History)
6 users (show)

See Also:


Attachments
jstack thread dump of hanging eclipse at close (63.57 KB, text/plain)
2016-08-15 04:13 EDT, Johan Burstedt CLA
no flags Details
new example of hanging eclipse (52.86 KB, text/plain)
2016-08-22 03:44 EDT, Johan Burstedt CLA
no flags Details
Eclipse STS 3.8.3 saving workspace freeze (44.82 KB, text/plain)
2017-02-16 04:45 EST, Dmitry Katsubo CLA
no flags Details
Shutdown hangs, jstack output (28.67 KB, text/plain)
2017-04-13 16:29 EDT, Christian Schäfer CLA
no flags Details
Configuration details, Oxygen for Committers (1.92 MB, text/plain)
2017-05-17 05:35 EDT, Vasili Gulevich CLA
no flags Details
Jstack dump of Eclipse shutdown hung saving workbench state (27.62 KB, text/plain)
2017-05-25 13:26 EDT, connor neuhaus CLA
no flags Details
Thread dump (26.15 KB, application/octet-stream)
2017-09-27 07:35 EDT, Radek Wikturna CLA
no flags Details
Eclipse STS 3.9.1 / Eclipse 4.7.1a saving workspace freeze (34.52 KB, text/plain)
2018-04-12 10:54 EDT, Dmitry Katsubo CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Johan Burstedt CLA 2016-08-03 03:48:30 EDT
Eclipse hang saving workspace - workbench state on exit
Comment 1 Johan Burstedt CLA 2016-08-03 03:50:31 EDT
Happens frequently on my windows 7. Have to kill E using Task manager.
Comment 2 Andrey Loskutov CLA 2016-08-03 04:00:38 EDT
Please provide exact version of your Eclipse.
Please create thread dump with jstack at the time Eclipse hangs and attach it here.
Comment 3 Johan Burstedt CLA 2016-08-15 04:13:04 EDT
Created attachment 263587 [details]
jstack thread dump of hanging eclipse at close
Comment 4 Johan Burstedt CLA 2016-08-15 04:16:01 EDT
Version: Mars.2 Release (4.5.2)
Build id: 20160218-0600
Comment 5 Andrey Loskutov CLA 2016-08-15 05:21:52 EDT
Looks like Mylyn does some weird things and hangs in ExternalizationManager, see

"ModalContext" #1299 prio=6 os_prio=0 tid=0x000000002008d000 nid=0x33c8 in Object.wait() [0x000000001d5ee000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        at org.eclipse.core.internal.jobs.Semaphore.acquire(Semaphore.java:39)
        - locked <0x00000000edee7ff0> (a org.eclipse.core.internal.jobs.Semaphore)
        at org.eclipse.core.internal.jobs.JobManager.join(JobManager.java:909)
        at org.eclipse.core.internal.jobs.InternalJob.join(InternalJob.java:341)
        at org.eclipse.core.runtime.jobs.Job.join(Job.java:458)
        at org.eclipse.mylyn.internal.tasks.core.externalization.ExternalizationManager.saveNow(ExternalizationManager.java:162)
        at org.eclipse.mylyn.internal.tasks.core.externalization.ExternalizationManager.stop(ExternalizationManager.java:143)
        at org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin$5.saving(TasksUiPlugin.java:604)
        at org.eclipse.core.internal.resources.SaveManager.executeLifecycle(SaveManager.java:387)
        at org.eclipse.core.internal.resources.SaveManager$1.run(SaveManager.java:196)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
        at org.eclipse.core.internal.resources.SaveManager.broadcastLifecycle(SaveManager.java:199)
        at org.eclipse.core.internal.resources.SaveManager.save(SaveManager.java:1184)
        at org.eclipse.core.internal.resources.Workspace.save(Workspace.java:2270)
        at org.eclipse.ui.internal.ide.application.IDEWorkbenchAdvisor$4.run(IDEWorkbenchAdvisor.java:453)
        at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)
Comment 6 Sam Davis CLA 2016-08-15 14:07:20 EDT
This is reminiscent of bug 392794 but seems to be different. But it looks like it could be a bug in the jobs framework again - this code should not hang unless the saveJob is running, but it is not in the thread dump:

bc. saveJob.schedule();
			saveJob.wakeUp();
			saveJob.join();
Comment 7 Johan Burstedt CLA 2016-08-22 03:44:03 EDT
Created attachment 263693 [details]
new example of hanging eclipse

C:\Java\eclipse-java-mars-R-win32-x86_64\eclipse\configuration>more config.ini
#This configuration file was written by: org.eclipse.equinox.internal.frameworkadmin.equinox.EquinoxFwConfigFileParser
#Wed Aug 17 15:01:39 CEST 2016
org.eclipse.update.reconcile=false
eclipse.p2.profile=epp.package.java
osgi.instance.area.default=@user.home/workspace
osgi.framework=file\:plugins/org.eclipse.osgi_3.10.102.v20160118-1700.jar
equinox.use.ds=true
eclipse.buildId=4.5.2.M20160212-1500
osgi.bundles=reference\:file\:org.eclipse.equinox.simpleconfigurator_1.1.100.v20150423-1455.jar@1\:start
org.eclipse.equinox.simpleconfigurator.configUrl=file\:org.eclipse.equinox.simpleconfigurator/bundles.info
eclipse.product=org.eclipse.platform.ide
osgi.splashPath=platform\:/base/plugins/org.eclipse.platform
osgi.framework.extensions=reference\:file\:org.eclipse.osgi.compatibility.state_1.0.100.v20150402-1551.jar,reference\:file\:org.eclipse.equinox.weaving.hook_1.1.100.v20140821-1915.jar,reference\:file\:org.eclipse.fx.osgi_2.1.0.201508240501.jar
osgi.bundles.defaultStartLevel=4
eclipse.application=org.eclipse.ui.ide.workbench
eclipse.p2.data.area=@config.dir/../p2/

C:\Java\eclipse-java-mars-R-win32-x86_64\eclipse\configuration>
Comment 8 Dmitry Katsubo CLA 2017-02-16 04:45:43 EST
Created attachment 266841 [details]
Eclipse STS 3.8.3 saving workspace freeze

I have the same problem on Eclipse STS 3.8.3 (based on Eclipse 4.6.2). The stack is similar to those reported before.
Comment 9 Christian Schäfer CLA 2017-04-13 16:29:14 EDT
Created attachment 267801 [details]
Shutdown hangs, jstack output
Comment 10 Christian Schäfer CLA 2017-04-13 16:31:09 EDT
I experienced the same issue today for the first time. I run Eclipse neon.3. I see two threads waiting 

at org.eclipse.core.runtime.jobs.Job.join(Job.java:524)

"ModalContext" and "Worker-282"
Comment 11 Vasili Gulevich CLA 2017-05-17 05:35:53 EDT
Created attachment 268393 [details]
Configuration details, Oxygen for Committers

Reproduced on 

Eclipse IDE for Eclipse Committers

Version: Oxygen Release Milestone 6 (4.7.0 M6)
Build id: 20170316-1528

Attached is configuration dump
Comment 12 connor neuhaus CLA 2017-05-25 13:26:35 EDT
Created attachment 268572 [details]
Jstack dump of Eclipse shutdown hung saving workbench state
Comment 13 connor neuhaus CLA 2017-05-25 13:27:16 EDT
Comment on attachment 268572 [details]
Jstack dump of Eclipse shutdown hung saving workbench state

1st time posting - hope this is correct and useful, SORRY!
Comment 14 Radek Wikturna CLA 2017-09-27 07:33:37 EDT
I've experienced this many times before, ussualy every day! I currently haver Neon.3 but I experenced the problem with older releases as well.
Hints: I normally have Eclipse open the whole day (even overnight) and have 3-5 huge Java projects in my worskspace. Just now it happened that I was debugging, left the computer for 2 hours. Then cam back and Open Type nor Open Resource stopped working (type something but nothing found). Stopping the application from the Debug view (stop button) didn't stop the project. Thease are the typical symptoms. That's when I needed to restart Eclise. And then the Save Workspace dialog appers and stops in about 1/3 and hangs indefinitely. So I kill Eclipse and strart it again. 
What's totally annonying that hitting Ctrl+B (build all) starts Clean & build of the last project, which takes some time!
Comment 15 Radek Wikturna CLA 2017-09-27 07:35:23 EDT
Created attachment 270700 [details]
Thread dump

Thread dump made from visualvm
Comment 16 Dmitry Katsubo CLA 2018-04-12 10:54:29 EDT
Created attachment 273565 [details]
Eclipse STS 3.9.1 / Eclipse 4.7.1a saving workspace freeze

I observe the same behaviour as in comment #14. It seems to be related to the amount of memory that Eclipse JVM consumes, because I don't observe problem when closing Eclipse after short period of working in it (e.g. one day).

Attaching thread dump for Eclipse STS 3.9.1 build on Eclipse 4.7.1a.

OpenJDK9 x64 build 9-internal+0-adhoc..openjdk
Command line: javaw.exe -Dosgi.requiredJavaVersion=1.8 --add-modules=ALL-SYSTEM -Dosgi.module.lock.timeout=10 -Dorg.eclipse.swt.browser.IEVersion=10001 -Xmx3000m -jar .../org.eclipse.equinox.launcher_1.4.0.v20161219-1356.jar -os win32 -ws win32 -arch x86_64 -showsplash -launcher ...\STS.exe -name STS --launcher.library .../org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.550.v20170928-1359\eclipse_1629.dll -startup .../org.eclipse.equinox.launcher_1.4.0.v20161219-1356.jar --launcher.overrideVmargs -exitdata 1554_68 -product org.springsource.sts.ide -vm .../bin/javaw.exe -vmargs -Dosgi.requiredJavaVersion=1.8 --add-modules=ALL-SYSTEM -Dosgi.module.lock.timeout=10 -Dorg.eclipse.swt.browser.IEVersion=10001 -Xmx3000m -jar .../org.eclipse.equinox.launcher_1.4.0.v20161219-1356.jar                       
javaw memory (private working working set): 3663572K ~ 3.5GB
Comment 17 Jim Fell CLA 2018-07-10 10:08:21 EDT
I'm experiencing this problem as well.  Is this on anybody's radar to get fixed?
Comment 18 Eclipse Webmaster CLA 2022-11-15 11:45:08 EST
Mylyn has been restructured, and our issue tracking has moved to GitHub [1].

We are closing ~14K Bugzilla issues to give the new team a fresh start. If you feel that this issue is still relevant, please create a new one on GitHub.

[1] https://github.com/orgs/eclipse-mylyn