Bug 311229 - Workspace easily corrupted
Summary: Workspace easily corrupted
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.5.2   Edit
Hardware: PC Windows 7
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-30 14:52 EDT by Jon Barrilleaux CLA
Modified: 2022-12-14 16:05 EST (History)
3 users (show)

See Also:


Attachments
Thread dump of eclipse while hung "initializing java toolig (1%)" (20.69 KB, text/plain)
2010-04-30 17:03 EDT, Jon Barrilleaux CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jon Barrilleaux CLA 2010-04-30 14:52:57 EDT
Build Identifier: M20100211-1343

On occasion, when using TPTP, and when moving/renaming packages and projects via refactoring, the affected workspace gets corrupted -- eclipse fails to start, usually stalling with the message "initializing JDT tooling".  Other workspaces are not affected.

My first suspicions would be polarion/SVN (which has ALWAYS been flaky regarding refactoring), but the problem has occurred most often when using TPTP, when releasing TPTP resources (I forget the exact terminology).

To date, the only solution is to delete the workspace in the file system, and then rebuild the workspace from scratch, from the repository -- not a pleasant solution, especially since I have now done it almost once a week.  I have tried half measures, of deleting bits and pieces of the metadata and project files in the workspace, but to no avail.  It seems to be all or nothing, or you end up with a lobotomized workspace that SVN goes bonkers over.

(BTW: I can't begin to tell you how truly bad SVN support in Eclipse continues to be. I've given up long ago submitting bugs).

Reproducible: Sometimes
Comment 1 Remy Suen CLA 2010-04-30 15:44:50 EDT
(In reply to comment #0)
> eclipse fails to
> start, usually stalling with the message "initializing JDT tooling".

There's been several of these bugs reported over the past year or so. If you query bugzilla you should hit a few of these. What kind of Java development are you doing anyway? Regular Java applications? Servlets and Tomcat-ish stuff? OSGi bundles/Eclipse plug-ins?

(In reply to comment #0)
> (BTW: I can't begin to tell you how truly bad SVN support in Eclipse continues
> to be. I've given up long ago submitting bugs).

Well I'm moving this bug to the Java tooling team but you'll have to take it up with Subversive for your Subversion concerns...though it seems you've given up on that avenue, sorry to hear that.
Comment 2 Olivier Thomann CLA 2010-04-30 15:53:53 EDT
This is very likely a deadlock in the container initialization.
I would report to TPTP to find out what kind of specific classpath container they are defining.
Comment 3 Remy Suen CLA 2010-04-30 15:56:31 EDT
I forgot to mention this, but if you get into the state where it hangs again, please try to capture a thread dump. Thanks, Jon.
http://wiki.eclipse.org/How_to_report_a_deadlock
Comment 4 Olivier Thomann CLA 2010-04-30 15:59:25 EDT
A thread dump is probably the only way to make progress on this.
Comment 5 Jon Barrilleaux CLA 2010-04-30 16:41:56 EDT
(In reply to comment #1)
> (In reply to comment #0)
> > eclipse fails to
> > start, usually stalling with the message "initializing JDT tooling".
> 
> There's been several of these bugs reported over the past year or so. If you
> query bugzilla you should hit a few of these. What kind of Java development are
> you doing anyway? Regular Java applications? Servlets and Tomcat-ish stuff?
> OSGi bundles/Eclipse plug-ins?

I'm doing vanilla java development (no plugins, no web stuff, nothing fancy), but with many projects (25).


(In reply to comment #2)
> This is very likely a deadlock in the container initialization.
> I would report to TPTP to find out what kind of specific classpath container
> they are defining.

No, it most recently happened without TPTP anywhere in sight.  Perhaps the corruption from these two cases (one TPTP, the other a crappy refactor due to Subversive) are related, but in an area common to both (resource/file management?).
Comment 6 Jon Barrilleaux CLA 2010-04-30 17:03:43 EDT
Created attachment 166685 [details]
Thread dump of eclipse while hung "initializing java toolig (1%)"
Comment 7 Jon Barrilleaux CLA 2010-04-30 17:04:37 EDT
(In reply to comment #3)
> I forgot to mention this, but if you get into the state where it hangs again,
> please try to capture a thread dump. Thanks, Jon.
> http://wiki.eclipse.org/How_to_report_a_deadlock

I saved the corrupt workspace and the problem (as has always been the case) is 100% reproducible.  Attached is the thread dump, but the tool couldn't even recognize the hung eclipse as eclipse (I had to find the PID via the task manager), so it may not tell you much.
Comment 8 Stephan Herrmann CLA 2010-04-30 18:12:11 EDT
That sure looks like an interesting stack trace!

Quick findings:
Thread "Worker-0" and "Worker-5", both related to SVN, both are
doing some class loading. Since "Worker-0" is blocked trying to
lock a class loader I could imagine that one of the ClassLoader.loadClass()
in "Worker-5" is actually holding that look (unfortunately this lock
isn't shown in the stack trace).

"Worker-5" looks suspecious to me, like its doing too much work during
its bundle activator. Perhaps "Worker-5" actually triggered the Job
for "Worker-0" , waiting for an answer (see SVNTeamPlugin.getOptionProvider())
in "Worker-0", but "Worker-0" can't complete because it can't obtain
a classloader lock. This discovery stuff is pretty new and I wouldn't be
surprised if it doesn't prove threadsafe.

But maybe its even more complex involving some more threads.

Should we ask subversive for comments?
Comment 9 Stephan Herrmann CLA 2010-04-30 18:22:14 EDT
BTW, if classloading is really the issue, there might be a workaround:
add this line to configuration/config.ini

osgi.classloader.lock=classname

which switches the OSGi classloader to more fine grained locking.
Comment 10 Jon Barrilleaux CLA 2010-04-30 19:00:40 EDT
Since my last update, when I ran jvisualvm to get the thread dump from the bad workspace, it seems that I somehow subsequently switched an open eclipse window to the bad workspace, and it worked just fine -- a miraculous recovery.

Could running jvisualvm have done anything?  I'm pretty sure I didn't do anything to the workspace.

And, for what it's worth, the previous 3 times I got corrupted workspaces it was TPTP related, and none of those ever recovered, in spite of opening, switching, rebooting, etc.

(BTW: Including the workspace name it the window title was an enhancement suggested LONG ago, and as I recall, it was marked as "don't fix". Why is beyond me, but this is something that is sorely needed as developers, such as myself, are becoming more and more workspace-centric.)
Comment 11 Stephan Herrmann CLA 2010-04-30 19:04:39 EDT
OK, bugzilla search was down for a moment (bug 311244), but now that
it's back, I see plenty of related bugs, assuming that this is 
actually one of the many duplicates of bug 291603.

Jon, could you verify that you are using a version of subversive
that does not contain the fix for bug 291603?
Comment 12 Remy Suen CLA 2010-04-30 19:08:33 EDT
(In reply to comment #10)
> (BTW: Including the workspace name it the window title was an enhancement
> suggested LONG ago, and as I recall, it was marked as "don't fix". Why is
> beyond me, but this is something that is sorely needed as developers, such as
> myself, are becoming more and more workspace-centric.)

Jon, add -showlocation as an argument to Eclipse via the eclipse.ini file. Here's an example.

-showlocation
-startup
plugins/org.eclipse.equinox.launcher_1.1.0.v20100419.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.0.v20100322-1720
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Xms40m
-Xmx384m

In the future, please open separate enhancement requests, bugs, or inquire on the forums so we can keep this particular bug focused on the one issue you are raising.
http://www.eclipse.org/forums/
Comment 13 Jon Barrilleaux CLA 2010-04-30 19:35:06 EDT
(In reply to comment #11)
> OK, bugzilla search was down for a moment (bug 311244), but now that
> it's back, I see plenty of related bugs, assuming that this is 
> actually one of the many duplicates of bug 291603.
> 
> Jon, could you verify that you are using a version of subversive
> that does not contain the fix for bug 291603?

I am using their latest version which, after checking, is indeed the one mentioned in the bug fix.
Comment 14 Olivier Thomann CLA 2010-04-30 22:24:02 EDT
Could you please try the same workspace without subversive?
Comment 15 Jon Barrilleaux CLA 2010-05-01 16:02:10 EDT
(In reply to comment #14)
> Could you please try the same workspace without subversive?

As I mentioned above, the corrupted workspace miraculously healed.  It no longer hangs, so I can't try anything.  Next time it happens I'll try all the things you guys are suggesting (time andpatience alowing).
Comment 16 Eclipse Genie CLA 2020-06-30 17:31:02 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 17 Eclipse Genie CLA 2022-12-14 16:05:30 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.