Home

Eclipse + Scala-IDE, DEADLOCK (FIXED, SORT OF)

February 22, 2011

FIXED IN http://download.scala-ide.org/nightly-update-wip-experiment-trunk (This is a nightly build, based on latest as 2011-02-22, Scala 2.9.)
Unfortunately, this version of the plugin takes 7 times longer (45-50 minutes) to perform a from-scratch project rebuild, and incremental changes are just as costly as clean rebuilds. This is clearly not usable. However, it is possible to use the new version, to clear the deadlocking state, and revert to 2.8.0, which can perform incremental rebuilds in a few seconds.

Sometimes, when I start Eclipse (Helios, M20100909-0800) with the Scala 2.8.0 Helios plugin, it never makes it past the splash screen, and CPU consumption falls to zero. Updating to the 2.8.1 version of the plugin is not an option (yet) because of this other bug. When (apparent) deadlock happens, jconsole can be very helpful in determining what’s really gloing on:JConsoleEclipseStart

Which takes you here:

JConsoleButtons

And lo:

JConsoleTheDeadlock

Here’s the per-thread deadlock information from the pane in the lower right:

Name: org.eclipse.jdt.internal.ui.text.JavaReconciler
State: BLOCKED on scala.tools.eclipse.javaelements.ScalaSourceFile@63273e5b owned by: org.eclipse.jdt.internal.ui.text.JavaReconciler
Total blocked: 15  Total waited: 3

Stack trace: 
scala.tools.eclipse.javaelements.ScalaSourceFile.file(ScalaSourceFile.scala:79)
scala.tools.eclipse.ScalaPresentationCompiler.discardCompilerResult(ScalaPresentationCompiler.scala:110)
scala.tools.eclipse.javaelements.ScalaCompilationUnit$$anonfun$discard$1.apply(ScalaCompilationUnit.scala:74)
scala.tools.eclipse.javaelements.ScalaCompilationUnit$$anonfun$discard$1.apply(ScalaCompilationUnit.scala:74)
scala.tools.eclipse.util.Cached$$anonfun$apply$3.apply(Cached.scala:58)
scala.tools.eclipse.util.Cached$class.locked(Cached.scala:83)
scala.tools.eclipse.util.Cached$class.apply(Cached.scala:56)
scala.tools.eclipse.ScalaProject$$anon$1.apply(ScalaProject.scala:40)
scala.tools.eclipse.ScalaProject.withPresentationCompiler(ScalaProject.scala:362)
scala.tools.eclipse.javaelements.ScalaCompilationUnit$class.discard(ScalaCompilationUnit.scala:74)
scala.tools.eclipse.javaelements.ScalaSourceFile.discard(ScalaSourceFile.scala:40)
scala.tools.eclipse.javaelements.ScalaCompilationUnit$class.close(ScalaCompilationUnit.scala:78)
scala.tools.eclipse.javaelements.ScalaSourceFile.close(ScalaSourceFile.scala:40)
org.eclipse.jdt.internal.core.JavaModelManager.closeChildren(JavaModelManager.java:3491)
org.eclipse.jdt.internal.core.JavaModelManager.putInfos(JavaModelManager.java:3455)
   - locked org.eclipse.jdt.internal.core.JavaModelManager@406ea85e
org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:529)
org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:252)
org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:238)
org.eclipse.jdt.internal.core.JavaElement.getChildren(JavaElement.java:193)
scala.tools.eclipse.contribution.weaving.jdt.core.NameLookupAspect.ajc$around$scala_tools_eclipse_contribution_weaving_jdt_core_NameLookupAspect$1$1c7010b1(NameLookupAspect.aj:73)
org.eclipse.jdt.internal.core.NameLookup.seekTypesInSourcePackage(NameLookup.java:1066)
org.eclipse.jdt.internal.core.NameLookup.seekTypes(NameLookup.java:987)
org.eclipse.jdt.internal.core.NameLookup.findType(NameLookup.java:776)
org.eclipse.jdt.internal.core.NameLookup.findType(NameLookup.java:660)
org.eclipse.jdt.internal.core.NameLookup.findType(NameLookup.java:619)
org.eclipse.jdt.internal.core.SearchableEnvironment.find(SearchableEnvironment.java:101)
org.eclipse.jdt.internal.core.SearchableEnvironment.findType(SearchableEnvironment.java:287)
org.eclipse.jdt.internal.core.CancelableNameEnvironment.findType(CancelableNameEnvironment.java:45)
org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForType(LookupEnvironment.java:128)
org.eclipse.jdt.internal.compiler.lookup.PackageBinding.getType(PackageBinding.java:127)
org.eclipse.jdt.internal.compiler.lookup.PackageBinding.isViewedAsDeprecated(PackageBinding.java:211)
org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding.isViewedAsDeprecated(ReferenceBinding.java:1217)
org.eclipse.jdt.internal.compiler.lookup.ClassScope.checkAndSetModifiers(ClassScope.java:420)
org.eclipse.jdt.internal.compiler.lookup.ClassScope.buildType(ClassScope.java:376)
org.eclipse.jdt.internal.compiler.lookup.ClassScope.buildMemberTypes(ClassScope.java:264)
org.eclipse.jdt.internal.compiler.lookup.ClassScope.buildType(ClassScope.java:378)
org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.buildTypeBindings(CompilationUnitScope.java:144)
org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.buildTypeBindings(LookupEnvironment.java:153)
org.eclipse.jdt.internal.compiler.Compiler.internalBeginToCompile(Compiler.java:717)
org.eclipse.jdt.internal.compiler.Compiler.beginToCompile(Compiler.java:377)
org.eclipse.jdt.internal.compiler.Compiler.resolve(Compiler.java:862)
org.eclipse.jdt.internal.compiler.Compiler.resolve(Compiler.java:928)
org.eclipse.jdt.internal.core.CompilationUnitProblemFinder.process_aroundBody0(CompilationUnitProblemFinder.java:189)
org.eclipse.jdt.internal.core.CompilationUnitProblemFinder.process_aroundBody1$advice(CompilationUnitProblemFinder.java:246)
org.eclipse.jdt.internal.core.CompilationUnitProblemFinder.process_aroundBody2(CompilationUnitProblemFinder.java:1)
org.eclipse.jdt.internal.core.CompilationUnitProblemFinder$AjcClosure3.run(CompilationUnitProblemFinder.java:1)
scala.tools.eclipse.contribution.weaving.jdt.core.CompilationUnitProblemFinderAspect.ajc$around$scala_tools_eclipse_contribution_weaving_jdt_core_CompilationUnitProblemFinderAspect$1$3edd546aproceed(CompilationUnitProblemFinderAspect.aj:1)
scala.tools.eclipse.contribution.weaving.jdt.core.CompilationUnitProblemFinderAspect.ajc$around$scala_tools_eclipse_contribution_weaving_jdt_core_CompilationUnitProblemFinderAspect$1$3edd546a(CompilationUnitProblemFinderAspect.aj:49)
org.eclipse.jdt.internal.core.CompilationUnitProblemFinder.process(CompilationUnitProblemFinder.java:156)
org.eclipse.jdt.internal.core.CompilationUnitProblemFinder.process(CompilationUnitProblemFinder.java:255)
org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.makeConsistent(ReconcileWorkingCopyOperation.java:190)
org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.executeOperation(ReconcileWorkingCopyOperation.java:89)
org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:728)
org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:788)
org.eclipse.jdt.internal.core.CompilationUnit.reconcile(CompilationUnit.java:1244)
org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:126)
org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.access$0(JavaReconcilingStrategy.java:108)
org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy$1.run(JavaReconcilingStrategy.java:89)
org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:87)
org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.initialReconcile(JavaReconcilingStrategy.java:178)
org.eclipse.jdt.internal.ui.text.CompositeReconcilingStrategy.initialReconcile(CompositeReconcilingStrategy.java:114)
org.eclipse.jdt.internal.ui.text.JavaCompositeReconcilingStrategy.initialReconcile(JavaCompositeReconcilingStrategy.java:133)
org.eclipse.jface.text.reconciler.MonoReconciler.initialProcess(MonoReconciler.java:105)
org.eclipse.jdt.internal.ui.text.JavaReconciler.initialProcess(JavaReconciler.java:398)
   - locked java.lang.Object@35fba309
org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:173)
Name: org.eclipse.jdt.internal.ui.text.JavaReconciler
State: BLOCKED on org.eclipse.jdt.internal.core.JavaModelManager@406ea85e owned by: org.eclipse.jdt.internal.ui.text.JavaReconciler
Total blocked: 28  Total waited: 1

Stack trace: 
org.eclipse.jdt.internal.core.JavaModelManager.getInfo(JavaModelManager.java:1913)
org.eclipse.jdt.internal.core.Openable.exists(Openable.java:183)
org.eclipse.jdt.internal.core.PackageFragmentRoot.getUnderlyingResource(PackageFragmentRoot.java:694)
org.eclipse.jdt.internal.core.PackageFragment.getUnderlyingResource(PackageFragment.java:337)
org.eclipse.jdt.internal.core.Openable.getUnderlyingResource(Openable.java:334)
org.eclipse.jdt.internal.core.CompilationUnit.getUnderlyingResource(CompilationUnit.java:930)
org.eclipse.jdt.internal.core.CompilationUnit.getCorrespondingResource(CompilationUnit.java:693)
scala.tools.eclipse.javaelements.ScalaSourceFile.liftedTree1$1(ScalaSourceFile.scala:80)
scala.tools.eclipse.javaelements.ScalaSourceFile.file(ScalaSourceFile.scala:80)
   - locked scala.tools.eclipse.javaelements.ScalaSourceFile@63273e5b
scala.tools.eclipse.javaelements.ScalaCompilationUnit$$anon$1.create(ScalaCompilationUnit.scala:49)
scala.tools.eclipse.javaelements.ScalaCompilationUnit$$anon$1.create(ScalaCompilationUnit.scala:35)
scala.tools.eclipse.util.Cached$class.apply(Cached.scala:44)
scala.tools.eclipse.javaelements.ScalaCompilationUnit$$anon$1.apply(ScalaCompilationUnit.scala:35)
scala.tools.eclipse.javaelements.ScalaCompilationUnit$class.withCompilerResult(ScalaCompilationUnit.scala:58)
scala.tools.eclipse.javaelements.ScalaSourceFile.withCompilerResult(ScalaSourceFile.scala:40)
scala.tools.eclipse.javaelements.ScalaCompilationUnit$class.buildStructure(ScalaCompilationUnit.scala:87)
scala.tools.eclipse.javaelements.ScalaSourceFile.buildStructure(ScalaSourceFile.scala:40)
org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:258)
org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:515)
org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:252)
org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:238)
org.eclipse.jdt.internal.core.JavaElement.getChildren(JavaElement.java:193)
scala.tools.eclipse.javaelements.ScalaSourceFile.getCorrespondingElement(ScalaSourceFile.scala:96)
scala.tools.eclipse.javaelements.ScalaSourceFile.getType(ScalaSourceFile.scala:102)
scala.tools.eclipse.contribution.weaving.jdt.core.NameLookupAspect.ajc$around$scala_tools_eclipse_contribution_weaving_jdt_core_NameLookupAspect$1$1c7010b1(NameLookupAspect.aj:83)
org.eclipse.jdt.internal.core.NameLookup.seekTypesInSourcePackage(NameLookup.java:1066)
org.eclipse.jdt.internal.core.NameLookup.seekTypes(NameLookup.java:987)
org.eclipse.jdt.internal.core.NameLookup.findType(NameLookup.java:776)
org.eclipse.jdt.internal.core.NameLookup.findType(NameLookup.java:660)
org.eclipse.jdt.internal.core.NameLookup.findType(NameLookup.java:619)
org.eclipse.jdt.internal.core.SearchableEnvironment.find(SearchableEnvironment.java:101)
org.eclipse.jdt.internal.core.SearchableEnvironment.findType(SearchableEnvironment.java:287)
org.eclipse.jdt.internal.core.CancelableNameEnvironment.findType(CancelableNameEnvironment.java:45)
org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForType(LookupEnvironment.java:128)
org.eclipse.jdt.internal.compiler.lookup.PackageBinding.getTypeOrPackage(PackageBinding.java:183)
org.eclipse.jdt.internal.compiler.lookup.Scope.getTypeOrPackage(Scope.java:2613)
org.eclipse.jdt.internal.compiler.lookup.Scope.getType(Scope.java:2330)
org.eclipse.jdt.internal.compiler.ast.SingleTypeReference.getTypeBinding(SingleTypeReference.java:44)
org.eclipse.jdt.internal.compiler.ast.TypeReference.internalResolveType(TypeReference.java:131)
org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveType(TypeReference.java:207)
org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveSuperType(TypeReference.java:185)
org.eclipse.jdt.internal.compiler.lookup.ClassScope.findSupertype(ClassScope.java:1194)
org.eclipse.jdt.internal.compiler.lookup.ClassScope.connectSuperclass(ClassScope.java:888)
org.eclipse.jdt.internal.compiler.lookup.ClassScope.connectTypeHierarchy(ClassScope.java:1031)
org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.connectTypeHierarchy(CompilationUnitScope.java:299)
org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.completeTypeBindings(LookupEnvironment.java:191)
org.eclipse.jdt.internal.compiler.Compiler.internalBeginToCompile(Compiler.java:735)
org.eclipse.jdt.internal.compiler.Compiler.beginToCompile(Compiler.java:377)
org.eclipse.jdt.internal.compiler.Compiler.resolve(Compiler.java:862)
org.eclipse.jdt.internal.compiler.Compiler.resolve(Compiler.java:928)
org.eclipse.jdt.internal.core.CompilationUnitProblemFinder.process_aroundBody0(CompilationUnitProblemFinder.java:189)
org.eclipse.jdt.internal.core.CompilationUnitProblemFinder.process_aroundBody1$advice(CompilationUnitProblemFinder.java:246)
org.eclipse.jdt.internal.core.CompilationUnitProblemFinder.process_aroundBody2(CompilationUnitProblemFinder.java:1)
org.eclipse.jdt.internal.core.CompilationUnitProblemFinder$AjcClosure3.run(CompilationUnitProblemFinder.java:1)
scala.tools.eclipse.contribution.weaving.jdt.core.CompilationUnitProblemFinderAspect.ajc$around$scala_tools_eclipse_contribution_weaving_jdt_core_CompilationUnitProblemFinderAspect$1$3edd546aproceed(CompilationUnitProblemFinderAspect.aj:1)
scala.tools.eclipse.contribution.weaving.jdt.core.CompilationUnitProblemFinderAspect.ajc$around$scala_tools_eclipse_contribution_weaving_jdt_core_CompilationUnitProblemFinderAspect$1$3edd546a(CompilationUnitProblemFinderAspect.aj:49)
org.eclipse.jdt.internal.core.CompilationUnitProblemFinder.process(CompilationUnitProblemFinder.java:156)
org.eclipse.jdt.internal.core.CompilationUnitProblemFinder.process(CompilationUnitProblemFinder.java:255)
org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.makeConsistent(ReconcileWorkingCopyOperation.java:190)
org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.executeOperation(ReconcileWorkingCopyOperation.java:89)
org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:728)
org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:788)
org.eclipse.jdt.internal.core.CompilationUnit.reconcile(CompilationUnit.java:1244)
org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:126)
org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.access$0(JavaReconcilingStrategy.java:108)
org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy$1.run(JavaReconcilingStrategy.java:89)
org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:87)
org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.initialReconcile(JavaReconcilingStrategy.java:178)
org.eclipse.jdt.internal.ui.text.CompositeReconcilingStrategy.initialReconcile(CompositeReconcilingStrategy.java:114)
org.eclipse.jdt.internal.ui.text.JavaCompositeReconcilingStrategy.initialReconcile(JavaCompositeReconcilingStrategy.java:133)
org.eclipse.jface.text.reconciler.MonoReconciler.initialProcess(MonoReconciler.java:105)
org.eclipse.jdt.internal.ui.text.JavaReconciler.initialProcess(JavaReconciler.java:398)
   - locked java.lang.Object@1b8cbf8f
org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:173)

More gory details from jconsole:

VM Summary
Tuesday, February 22, 2011 11:31:27 AM EST
 
Connection name: 
pid: 6414 
Virtual Machine: 
Java HotSpot(TM) 64-Bit Server VM version 17.1-b03-307
Vendor: 
Apple Inc.
Name: 
6414@dr2chase.local
Uptime: 
23 minutes
Process CPU time: 
47.050 seconds
JIT compiler: 
HotSpot 64-Bit Server Compiler
Total compile time: 
29.825 seconds
 
Live threads: 
26
Peak: 
27
Daemon threads: 
21
Total threads started: 
30
Current classes loaded: 
9,595
Total classes loaded: 
9,595
Total classes unloaded: 
    0


 
Current heap size: 
  231,549 kbytes
Maximum heap size: 
2,066,432 kbytes
Committed memory: 
686,080 kbytes
Pending finalization: 
0 objects
Garbage collector: 
Name = 'ParNew', Collections = 8, Total time spent = 1.255 seconds
Garbage collector: 
Name = 'ConcurrentMarkSweep', Collections = 3, Total time spent = 1.425 seconds
 
Operating System: 
Mac OS X 10.6.6
Architecture: 
x86_64
Number of processors: 
2
Committed virtual memory: 
5,644,460 kbytes
Total physical memory: 
6,291,456 kbytes
Free physical memory: 
  291,928 kbytes
Total swap space: 
2,097,152 kbytes
Free swap space: 
  944,032 kbytes
 
VM arguments: 
-Xss8m -Xms700m -Xmx2048m -XX:NewSize=300m -server -XX:+DoEscapeAnalysis -XX:+UseConcMarkSweepGC -Xdock:icon=../Resources/Eclipse.icns -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts -XX:MaxPermSize=256m 
Class path: 
/Applications/eclipse-3.6.1/Eclipse.app/Contents/MacOS/../../../plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar
Library path: 
.:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java
Boot class path: 
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/jsfd.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/classes.jar:/System/Library/Frameworks/JavaVM.framework/Frameworks/JavaRuntimeSupport.framework/Resources/Java/JavaRuntimeSupport.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/ui.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/laf.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/sunrsasign.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/jsse.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/jce.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/charsets.jar

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: