Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 31074

Summary: lockup (it seems when to load a plugin?)
Product: [Eclipse Project] Platform Reporter: Johan Compagner <jcompagner>
Component: ResourcesAssignee: Platform-Resources-Inbox <platform-resources-inbox>
Status: RESOLVED WORKSFORME QA Contact:
Severity: major    
Priority: P3 CC: john.arthorne
Version: 2.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
the next hangup
none
just hanged again (looks the same i believe) none

Description Johan Compagner CLA 2003-02-06 05:39:45 EST
With the later build i do get lockups from time to time.
And it seems to happen with a ClassLoader (of a plugin) that's keeps waiting a 
a monitor, Eclipse does redraw for the most part (if it is redrawing) except 
the menu bar. That one stays completely white.

Here is the thread dump

Full thread dump Java HotSpot(TM) Server VM (1.4.1_01-b01 mixed mode):

"org.eclipse.jdt.internal.ui.text.JavaReconciler" daemon prio=2 tid=0x19A896E0 n
id=0xab4 in Object.wait() [1bdcf000..1bdcfdc0]
	at java.lang.Object.wait(Native Method)
        - waiting on <054E4BD0> (a 
org.eclipse.jface.text.reconciler.DirtyRegionQueue)
        at 
org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run
(AbstractReconciler.java:161)
        - locked <054E4BD0> (a 
org.eclipse.jface.text.reconciler.DirtyRegionQueue)

"Decoration" prio=2 tid=0x009D4480 nid=0xc10 in Object.wait() 
[1bd7f000..1bd7fdc0]
        at java.lang.Object.wait(Native Method)
        - waiting on <053CBF20> (a 
org.eclipse.ui.internal.decorators.DecorationScheduler)
        at java.lang.Object.wait(Object.java:426)
        at org.eclipse.ui.internal.decorators.DecorationScheduler.next
(DecorationScheduler.java:247)
        - locked <053CBF20> (a 
org.eclipse.ui.internal.decorators.DecorationScheduler)
        at org.eclipse.ui.internal.decorators.DecorationScheduler$3.run
(DecorationScheduler.java:273)
        at java.lang.Thread.run(Thread.java:536)

"Java indexing" daemon prio=4 tid=0x1A6D8728 nid=0xc5c waiting on condition 
[1bd3f000..1bd3fdc0]
        at java.lang.Thread.sleep(Native Method)
        at org.eclipse.jdt.internal.core.search.processing.JobManager.run
(JobManager.java:334)
        at java.lang.Thread.run(Thread.java:536)

"Signal Dispatcher" daemon prio=10 tid=0x009BD188 nid=0x8f4 waiting on condition
 [0..0]

"Finalizer" daemon prio=9 tid=0x009B9CA0 nid=0xb9c in Object.wait() 
[197ff000..197ffdc0]
        at java.lang.Object.wait(Native Method)
        - waiting on <04CDB178> (a java.lang.ref.ReferenceQueue$Lock)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:111)
        - locked <04CDB178> (a java.lang.ref.ReferenceQueue$Lock)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:127)
        at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)

"Reference Handler" daemon prio=10 tid=0x009B9070 nid=0xbb4 in Object.wait() [95
f000..95fdc0]
        at java.lang.Object.wait(Native Method)
        - waiting on <04CDB1E0> (a java.lang.ref.Reference$Lock)
        at java.lang.Object.wait(Object.java:426)
        at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:113)
        - locked <04CDB1E0> (a java.lang.ref.Reference$Lock)

"main" prio=5 tid=0x00034C38 nid=0x8f0 waiting for monitor entry [7e000..7fc28]
        at sun.misc.URLClassPath.getLoader(URLClassPath.java:266)
        - waiting to lock <04CE3348> (a sun.misc.URLClassPath)
        at sun.misc.URLClassPath.getResource(URLClassPath.java:155)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:190)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
        - locked <04CDB650> (a java.net.URLClassLoader)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
        at 
org.eclipse.core.internal.boot.DelegatingURLClassLoader.findClassParents
(DelegatingURLClassLoader.java:462)
        at 
org.eclipse.core.internal.plugins.PluginClassLoader.internalFindClassParentsSelf
(PluginClassLoader.java:154)
        - locked <04D017A0> (a 
org.eclipse.core.internal.plugins.PluginClassLoader)
        at 
org.eclipse.core.internal.boot.DelegatingURLClassLoader.findClassParentsSelf
(DelegatingURLClassLoader.java:490)
        at org.eclipse.core.internal.boot.DelegatingURLClassLoader.loadClass
(DelegatingURLClassLoader.java:882)
        at org.eclipse.core.internal.boot.DelegatingURLClassLoader.loadClass
(DelegatingURLClassLoader.java:862)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
        - locked <04D017A0> (a 
org.eclipse.core.internal.plugins.PluginClassLoader)
        at org.eclipse.jface.text.source.VerticalRuler.update
(VerticalRuler.java:400)
        at 
org.eclipse.jface.text.source.VerticalRuler$InternalListener.modelChanged
(VerticalRuler.java:69)
        at 
org.eclipse.jface.text.source.AnnotationModel.addAnnotationModelListener
(AnnotationModel.java:103)
        at 
org.eclipse.jface.text.source.VisualAnnotationModel.addAnnotationModelListener
(VisualAnnotationModel.java:61)
        at org.eclipse.jface.text.source.VerticalRuler.setModel
(VerticalRuler.java:433)
        at org.eclipse.jface.text.source.SourceViewer.setDocument
(SourceViewer.java:371)
        at org.eclipse.jface.text.source.SourceViewer.setDocument
(SourceViewer.java:338)
        at org.eclipse.ui.texteditor.AbstractTextEditor.initializeSourceViewer
(AbstractTextEditor.java:2179)
        at org.eclipse.ui.texteditor.AbstractTextEditor.createPartControl
(AbstractTextEditor.java:1980)
        at org.eclipse.ui.texteditor.StatusTextEditor.createPartControl
(StatusTextEditor.java:53)
        at com.objfac.xmleditor.XMLEditor.createPartControl(XMLEditor.java:1443)
        at org.eclipse.ui.internal.PartPane$4.run(PartPane.java:138)
        at org.eclipse.core.internal.runtime.InternalPlatform.run
(InternalPlatform.java:867)
        at org.eclipse.core.runtime.Platform.run(Platform.java:413)
        at org.eclipse.ui.internal.PartPane.createChildControl
(PartPane.java:134)
        at org.eclipse.ui.internal.PartPane.createControl(PartPane.java:183)
        at org.eclipse.ui.internal.EditorWorkbook.createPage
(EditorWorkbook.java:393)
        at org.eclipse.ui.internal.EditorWorkbook.add(EditorWorkbook.java:95)
        at org.eclipse.ui.internal.EditorArea.addEditor(EditorArea.java:49)
        at org.eclipse.ui.internal.EditorPresentation.openEditor
(EditorPresentation.java:352)
        at org.eclipse.ui.internal.EditorManager$2.run(EditorManager.java:556)
        at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:65)
        at org.eclipse.ui.internal.EditorManager.createEditorTab
(EditorManager.java:545)
        at org.eclipse.ui.internal.EditorManager.openInternalEditor
(EditorManager.java:639)
        at org.eclipse.ui.internal.EditorManager.openEditorFromDescriptor
(EditorManager.java:430)
        at org.eclipse.ui.internal.EditorManager.openEditorFromInput
(EditorManager.java:304)
        at org.eclipse.ui.internal.EditorManager.openEditor
(EditorManager.java:395)
        at org.eclipse.ui.internal.WorkbenchPage.openEditor
(WorkbenchPage.java:1988)
        at org.eclipse.ui.internal.WorkbenchPage.openEditor
(WorkbenchPage.java:1842)
        at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor
(EditorUtility.java:129)
        at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor
(EditorUtility.java:102)
        at org.eclipse.jdt.internal.ui.actions.OpenActionUtil.open
(OpenActionUtil.java:47)
        at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:158)
        at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:147)
        at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun
(SelectionDispatchAction.java:191)
        at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run
(SelectionDispatchAction.java:169)
        at 
org.eclipse.jdt.internal.ui.packageview.PackageExplorerActionGroup.handleOpen
(PackageExplorerActionGroup.java:326)
        at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$3.open
(PackageExplorerPart.java:308)
        at org.eclipse.jface.viewers.StructuredViewer$2.run
(StructuredViewer.java:397)
        at org.eclipse.core.internal.runtime.InternalPlatform.run
(InternalPlatform.java:867)
        at org.eclipse.core.runtime.Platform.run(Platform.java:413)
        at org.eclipse.jface.viewers.StructuredViewer.fireOpen
(StructuredViewer.java:395)
        at org.eclipse.jface.viewers.StructuredViewer.handleOpen
(StructuredViewer.java:602)
        at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen
(StructuredViewer.java:689)
        at org.eclipse.jface.util.OpenStrategy.fireOpenEvent
(OpenStrategy.java:203)
        at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:198)
        at org.eclipse.jface.util.OpenStrategy$1.handleEvent
(OpenStrategy.java:227)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:77)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:836)
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1692)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1410)
        at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1289)
        at org.eclipse.ui.internal.Workbench.run(Workbench.java:1272)
        at org.eclipse.core.internal.boot.InternalBootLoader.run
(InternalBootLoader.java:845)
        at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.eclipse.core.launcher.Main.basicRun(Main.java:247)
        at org.eclipse.core.launcher.Main.run(Main.java:703)
        at org.eclipse.core.launcher.Main.main(Main.java:539)

"VM Thread" prio=5 tid=0x009B85A0 nid=0xb00 runnable

"VM Periodic Task Thread" prio=10 tid=0x009BBE78 nid=0xc2c waiting on condition

"Suspend Checker Thread" prio=10 tid=0x009BC7C8 nid=0x8e4 runnable
Comment 1 Sonia Dimitrov CLA 2003-02-06 09:08:28 EST
Marking as duplicate of bug 30882 based on contents of thread dump.

*** This bug has been marked as a duplicate of 30882 ***
Comment 2 Johan Compagner CLA 2003-02-06 09:35:36 EST
Do you really think so?

Because this bug is really about the ClassLoader that seems to be locked. And 
it seems to do that when it wants to load a plugin.

After closer look it seems to do that when i open a XML file with XML Buddy 
plugin in the build of 20030502.

It can be that XML buddy doesn't work quite right with this build of eclipse. 
But then eclipse shouldn't completely hang for that
Comment 3 Tod Creasey CLA 2003-02-06 10:08:16 EST
Looks like you are right Johann. Moving to Text as it appears to be an issue
with creating vertical rules
Comment 4 Kai-Uwe Maetzel CLA 2003-02-06 10:20:56 EST
Moving to core. I don't see any reason why class loading should block in this 
situation. The code that is executed is the asyncExec call of the following 
snippet:

		if (fCanvas != null && !fCanvas.isDisposed()) {
			Display d= fCanvas.getDisplay();
			if (d != null) {
				d.asyncExec(new Runnable() {
					public void run() {
						redraw();
					}
				});
			}	
		}

Moving to core.
Comment 5 Bob Foster CLA 2003-02-06 18:23:43 EST
XMLBuddy 0.2.8 seems to load and work ok in the eclipse-SDK-I20030206 build on
my Win2K system. Perhaps something was broken in yesterday's build?

I do see a null pointer exception when Eclipse is launched with an editor window
open, where the editors are XMLBuddy or TextEditor. (The editors do open,
however.) I don't see this with the JDT editor. Unless this hang also happened
for .txt files, I assume it's a different issue.
Comment 6 John Arthorne CLA 2003-02-11 12:31:18 EST
Johan, the thread dump appears to be incomplete.  The main thread is waiting on
monitor 04CE3348, but there is no thread in the listing that has acquired that
monitor.  Could it be that you didn't include the entire dump?  Are you sure it
was deadlocked (CPU usage at 0%)?

Also, for future reference, it is better to attach the javacore file than to
paste the dump into a bugzilla comment.  That would avoid the automatic wrapping
of lines that makes your stack traces difficult to read.
Comment 7 Johan Compagner CLA 2003-02-13 16:44:19 EST
This was the only output i would get.

But here another one (but now when updating from CVS)
The CVS dialog says: Updating libsrc (a dir)

and then just hangs.

It seems to have something to do again with loading of the ClassLoader....
But still i don't see a deadlock

Comment 8 Johan Compagner CLA 2003-02-13 16:45:25 EST
Created attachment 3481 [details]
the next hangup
Comment 9 John Arthorne CLA 2003-02-13 17:44:06 EST
Thanks Johan.  Very strange stack traces though.  The symptoms are the same as
your original dump.  There is only one active thread (the ModalContext), and it
is blocked waiting for a lock deep in classloader code.  No other threads are
doing any classloading, so I don't know why this monitor is locked.

It's curious that most threads say "waiting on lock", while the ModalContext
thread says "waiting to lock".  I don't know if there's any significance to that.

If you do a couple of stack dumps on after the other, do they look identical?
Comment 10 Johan Compagner CLA 2003-02-18 09:02:24 EST
Created attachment 3546 [details]
just hanged again (looks the same i believe)

Another hang. (the menu is white, no CPU load what so ever)

Maybe importand this is how i start eclipse:
C:\eclipse\eclipse.exe -vm c:\jdk1.4.1\bin\java.exe -vmargs -server -Xmx300M
-Xms96M -verbose:gc -XX:PermSize=20m -Xverify:none -XX:CompileThreshold=500
Comment 11 Johan Compagner CLA 2003-02-18 09:03:42 EST
just another note.
After it hangs, there are no GC events anymore that just stops
Comment 12 John Arthorne CLA 2003-02-18 11:51:36 EST
I'm slightly suspicious of running in server mode (mainly because I don't know
of anyone who is using it when running Eclipse).  You might want to try not
running in server mode for awhile to see if that helps.  Personally, I would
just run with "-vmargs -Xmx300M".  Who knows what effect all that non-standard
GC fine tuning can have.

Your most recent stack trace doesn't have any active Eclipse code, it's just the
class library VM code.  This leads me to believe we're looking at a VM or class
library bug.
Comment 13 Johan Compagner CLA 2003-02-18 12:10:08 EST
i will try to start it with other params.

but for me server should be fine ofcourse because server should or would be 
used in the most critial applications (app servers....)

and for me Eclipse is almost a server app because i start it and only shut it 
down when i install a new eclipse or eclipse hangs Or i have to reboot my 
machine..

Eclipse sometimes be running for days on my laptop..

i use the -Xms96 flag because with my workspaces this is pretty good. It almost 
n ever goes over this memory. And keeps the GC much happier at startup..

The verbose:gc i just have to watch the GC. See what it does an how much it 
uses.

Because eclipse runs for a long time on my machine and it has many plugins 
which have again many classes i have the PermSize=20m so that classes and other 
meta data don't trigger a FullGC that much (i don't believe that all will fit 
in 4MB)

I use verify=none because it trust Eclipse :)

The last flag will slow down the Eclipse startup (but i don't start it up that 
often) but will speed up the normal operation when running for while because 
much more classes will be jitted by hotspot.
Comment 14 John Arthorne CLA 2003-07-08 18:41:53 EDT
Johan, are you still getting this with recent builds (3.0 M1)?  We fixed one
known deadlock since then (Bug 36358).  Please reopen if you're still seeing this.
Comment 15 Johan Compagner CLA 2003-07-09 05:42:04 EDT
i didn't encounter deadlocks for a long time now.