Randomly causing all of IDEA to hang

I have logged this bug (http://www.jetbrains.net/jira/browse/SCL-1320) against the Scala plugin. Has anyone any suggestions as to how I can make this go away (a cache to delete perhaps and then a settng to change)? It has got to the point where IDEA is freezing on launch and I'm therefore currently unable to get any work done - extremely frustrating!

I have tried re-installing IDEA and the issue persists. Help greatly appreciated.

FYI: the AWT event thread stack looks like:


"AWT-EventQueue-1 8.1.3#9886, eap:false"
at sun.misc.Unsafe.park(Native Method)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:747)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireShared(AbstractQueuedSynchronizer.java:877)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireShared(AbstractQueuedSynchronizer.java:1197)
at java.util.concurrent.locks.ReentrantReadWriteLock$ReadLock.lock(ReentrantReadWriteLock.java:594)
at com.intellij.util.concurrency.DefaultLockAdapter.lock(DefaultLockAdapter.java:32)
at com.intellij.psi.impl.CachedValueImpl.getValue(CachedValueImpl.java:97)
at org.jetbrains.plugins.scala.caches.CachesUtil$.get(CachesUtil.scala:29)
at org.jetbrains.plugins.scala.lang.psi.api.expr.ScExpression$class.cachedType(ScExpression.scala:30)
at org.jetbrains.plugins.scala.lang.psi.impl.expr.ScReferenceExpressionImpl.cachedType(ScReferenceExpressionImpl.scala:32)
at org.jetbrains.plugins.scala.lang.psi.impl.statements.ScFunctionDefinitionImpl.returnType(ScFunctionDefinitionImpl.scala:59)
at org.jetbrains.plugins.scala.lang.psi.implicits.ScImplicitlyConvertible$$anonfun$org$jetbrains$plugins$scala$lang$psi$implicits$ScImplicitlyConvertible$$buildImplicitMap$2$$anonfun$apply$3.apply(ScImplicitlyConvertible.scala:79)
at org.jetbrains.plugins.scala.lang.psi.implicits.ScImplicitlyConvertible$$anonfun$org$jetbrains$plugins$scala$lang$psi$implicits$ScImplicitlyConvertible$$buildImplicitMap$2$$anonfun$apply$3.apply(ScImplicitlyConvertible.scala:78)
at scala.Iterator$class.foreach(Iterator.scala:414)
at scala.runtime.BoxedArray$AnyIterator.foreach(BoxedArray.scala:45)
at scala.Iterable$class.foreach(Iterable.scala:256)
at scala.collection.immutable.Set1.foreach(Set1.scala:20)
at org.jetbrains.plugins.scala.lang.psi.implicits.ScImplicitlyConvertible$$anonfun$org$jetbrains$plugins$scala$lang$psi$implicits$ScImplicitlyConvertible$$buildImplicitMap$2.apply(ScImplicitlyConvertible.scala:78)
at org.jetbrains.plugins.scala.lang.psi.implicits.ScImplicitlyConvertible$$anonfun$org$jetbrains$plugins$scala$lang$psi$implicits$ScImplicitlyConvertible$$buildImplicitMap$2.apply(ScImplicitlyConvertible.scala:75)
at scala.Iterator$class.foreach(Iterator.scala:414)
at scala.runtime.BoxedArray$AnyIterator.foreach(BoxedArray.scala:45)
at scala.Iterable$class.foreach(Iterable.scala:256)
at scala.runtime.BoxedArray.foreach(BoxedArray.scala:24)
at org.jetbrains.plugins.scala.lang.psi.implicits.ScImplicitlyConvertible$class.org$jetbrains$plugins$scala$lang$psi$implicits$ScImplicitlyConvertible$$buildImplicitMap(ScImplicitlyConvertible.scala:75)
at org.jetbrains.plugins.scala.lang.psi.implicits.ScImplicitlyConvertible$$anonfun$implicitMap$1$$anonfun$apply$2.apply(ScImplicitlyConvertible.scala:42)
at org.jetbrains.plugins.scala.lang.psi.implicits.ScImplicitlyConvertible$$anonfun$implicitMap$1$$anonfun$apply$2.apply(ScImplicitlyConvertible.scala:42)
at org.jetbrains.plugins.scala.caches.CachesUtil$MyProvider.compute(CachesUtil.scala:33)
at com.intellij.psi.impl.CachedValueImpl.getValue(CachedValueImpl.java:8)
at org.jetbrains.plugins.scala.caches.CachesUtil$.get(CachesUtil.scala:29)
at org.jetbrains.plugins.scala.lang.psi.implicits.ScImplicitlyConvertible$class.implicitMap(ScImplicitlyConvertible.scala:40)
at org.jetbrains.plugins.scala.lang.psi.implicits.ScImplicitlyConvertible$class.getImplicitTypes(ScImplicitlyConvertible.scala:29)
at org.jetbrains.plugins.scala.lang.psi.impl.expr.ScReferenceExpressionImpl.getImplicitTypes(ScReferenceExpressionImpl.scala:32)
at org.jetbrains.plugins.scala.lang.psi.impl.expr.ScReferenceExpressionImpl.processTypes$1(ScReferenceExpressionImpl.scala:109)
at org.jetbrains.plugins.scala.lang.psi.impl.expr.ScReferenceExpressionImpl.org$jetbrains$plugins$scala$lang$psi$impl$expr$ScReferenceExpressionImpl$$_resolve(ScReferenceExpressionImpl.scala:140)
at org.jetbrains.plugins.scala.lang.psi.impl.expr.ScReferenceExpressionImpl$MyResolver$.resolve(ScReferenceExpressionImpl.scala:99)
at org.jetbrains.plugins.scala.lang.psi.impl.expr.ScReferenceExpressionImpl$MyResolver$.resolve(ScReferenceExpressionImpl.scala:79)
at com.intellij.psi.impl.source.resolve.ResolveCache.a(ResolveCache.java:81)
at com.intellij.psi.impl.source.resolve.ResolveCache.resolveWithCaching(ResolveCache.java:53)
at org.jetbrains.plugins.scala.lang.psi.impl.expr.ScReferenceExpressionImpl.multiResolve(ScReferenceExpressionImpl.scala:68)
at org.jetbrains.plugins.scala.lang.psi.api.base.ScReferenceElement$class.bind(ScReferenceElement.scala:24)
at org.jetbrains.plugins.scala.lang.psi.impl.expr.ScReferenceExpressionImpl.bind(ScReferenceExpressionImpl.scala:32)
at org.jetbrains.plugins.scala.lang.psi.impl.expr.ScReferenceExpressionImpl.getType(ScReferenceExpressionImpl.scala:148)
at org.jetbrains.plugins.scala.lang.psi.api.expr.ScExpression$$anonfun$cachedType$1$$anonfun$apply$1.apply(ScExpression.scala:32)
at org.jetbrains.plugins.scala.lang.psi.api.expr.ScExpression$$anonfun$cachedType$1$$anonfun$apply$1.apply(ScExpression.scala:32)
at org.jetbrains.plugins.scala.caches.CachesUtil$MyProvider.compute(CachesUtil.scala:33)
at com.intellij.psi.impl.CachedValueImpl.getValue(CachedValueImpl.java:8)
at org.jetbrains.plugins.scala.caches.CachesUtil$.get(CachesUtil.scala:29)
at org.jetbrains.plugins.scala.lang.psi.api.expr.ScExpression$class.cachedType(ScExpression.scala:30)
at org.jetbrains.plugins.scala.lang.psi.impl.expr.ScReferenceExpressionImpl.cachedType(ScReferenceExpressionImpl.scala:32)
at org.jetbrains.plugins.scala.lang.psi.impl.statements.ScFunctionDefinitionImpl.returnType(ScFunctionDefinitionImpl.scala:59)
at org.jetbrains.plugins.scala.lang.psi.implicits.ScImplicitlyConvertible$$anonfun$org$jetbrains$plugins$scala$lang$psi$implicits$ScImplicitlyConvertible$$buildImplicitMap$2$$anonfun$apply$3.apply(ScImplicitlyConvertible.scala:79)
at org.jetbrains.plugins.scala.lang.psi.implicits.ScImplicitlyConvertible$$anonfun$org$jetbrains$plugins$scala$lang$psi$implicits$ScImplicitlyConvertible$$buildImplicitMap$2$$anonfun$apply$3.apply(ScImplicitlyConvertible.scala:78)
at scala.Iterator$class.foreach(Iterator.scala:414)
at scala.runtime.BoxedArray$AnyIterator.foreach(BoxedArray.scala:45)
at scala.Iterable$class.foreach(Iterable.scala:256)
at scala.collection.immutable.Set1.foreach(Set1.scala:20)
at org.jetbrains.plugins.scala.lang.psi.implicits.ScImplicitlyConvertible$$anonfun$org$jetbrains$plugins$scala$lang$psi$implicits$ScImplicitlyConvertible$$buildImplicitMap$2.apply(ScImplicitlyConvertible.scala:78)
at org.jetbrains.plugins.scala.lang.psi.implicits.ScImplicitlyConvertible$$anonfun$org$jetbrains$plugins$scala$lang$psi$implicits$ScImplicitlyConvertible$$buildImplicitMap$2.apply(ScImplicitlyConvertible.scala:75)
at scala.Iterator$class.foreach(Iterator.scala:414)
at scala.runtime.BoxedArray$AnyIterator.foreach(BoxedArray.scala:45)
at scala.Iterable$class.foreach(Iterable.scala:256)
at scala.runtime.BoxedArray.foreach(BoxedArray.scala:24)
at org.jetbrains.plugins.scala.lang.psi.implicits.ScImplicitlyConvertible$class.org$jetbrains$plugins$scala$lang$psi$implicits$ScImplicitlyConvertible$$buildImplicitMap(ScImplicitlyConvertible.scala:75)
at org.jetbrains.plugins.scala.lang.psi.implicits.ScImplicitlyConvertible$$anonfun$implicitMap$1$$anonfun$apply$2.apply(ScImplicitlyConvertible.scala:42)
at org.jetbrains.plugins.scala.lang.psi.implicits.ScImplicitlyConvertible$$anonfun$implicitMap$1$$anonfun$apply$2.apply(ScImplicitlyConvertible.scala:42)
at org.jetbrains.plugins.scala.caches.CachesUtil$MyProvider.compute(CachesUtil.scala:33)
at com.intellij.psi.impl.CachedValueImpl.getValue(CachedValueImpl.java:8)
at org.jetbrains.plugins.scala.caches.CachesUtil$.get(CachesUtil.scala:29)
at org.jetbrains.plugins.scala.lang.psi.implicits.ScImplicitlyConvertible$class.implicitMap(ScImplicitlyConvertible.scala:40)
at org.jetbrains.plugins.scala.lang.psi.implicits.ScImplicitlyConvertible$class.getImplicitTypes(ScImplicitlyConvertible.scala:29)
at org.jetbrains.plugins.scala.lang.psi.impl.expr.ScReferenceExpressionImpl.getImplicitTypes(ScReferenceExpressionImpl.scala:32)
at org.jetbrains.plugins.scala.lang.psi.impl.expr.ScReferenceExpressionImpl.processTypes$1(ScReferenceExpressionImpl.scala:109)
at org.jetbrains.plugins.scala.lang.psi.impl.expr.ScReferenceExpressionImpl.org$jetbrains$plugins$scala$lang$psi$impl$expr$ScReferenceExpressionImpl$$_resolve(ScReferenceExpressionImpl.scala:140)
at org.jetbrains.plugins.scala.lang.psi.impl.expr.ScReferenceExpressionImpl$MyResolver$.resolve(ScReferenceExpressionImpl.scala:99)
at org.jetbrains.plugins.scala.lang.psi.impl.expr.ScReferenceExpressionImpl$MyResolver$.resolve(ScReferenceExpressionImpl.scala:79)
at com.intellij.psi.impl.source.resolve.ResolveCache.a(ResolveCache.java:81)
at com.intellij.psi.impl.source.resolve.ResolveCache.resolveWithCaching(ResolveCache.java:53)
at org.jetbrains.plugins.scala.lang.psi.impl.expr.ScReferenceExpressionImpl.multiResolve(ScReferenceExpressionImpl.scala:68)
at org.jetbrains.plugins.scala.lang.psi.api.base.ScReferenceElement$class.bind(ScReferenceElement.scala:24)
at org.jetbrains.plugins.scala.lang.psi.impl.expr.ScReferenceExpressionImpl.bind(ScReferenceExpressionImpl.scala:32)
at org.jetbrains.plugins.scala.lang.psi.impl.expr.ScReferenceExpressionImpl.getType(ScReferenceExpressionImpl.scala:148)
at org.jetbrains.plugins.scala.lang.psi.api.expr.ScExpression$$anonfun$cachedType$1$$anonfun$apply$1.apply(ScExpression.scala:32)
at org.jetbrains.plugins.scala.lang.psi.api.expr.ScExpression$$anonfun$cachedType$1$$anonfun$apply$1.apply(ScExpression.scala:32)
at org.jetbrains.plugins.scala.caches.CachesUtil$MyProvider.compute(CachesUtil.scala:33)
at com.intellij.psi.impl.CachedValueImpl.getValue(CachedValueImpl.java:8)
at org.jetbrains.plugins.scala.caches.CachesUtil$.get(CachesUtil.scala:29)
at org.jetbrains.plugins.scala.lang.psi.api.expr.ScExpression$class.cachedType(ScExpression.scala:30)
at org.jetbrains.plugins.scala.lang.psi.impl.expr.ScReferenceExpressionImpl.cachedType(ScReferenceExpressionImpl.scala:32)
at org.jetbrains.plugins.scala.lang.psi.impl.expr.ScReferenceExpressionImpl.processTypes$1(ScReferenceExpressionImpl.scala:105)
at org.jetbrains.plugins.scala.lang.psi.impl.expr.ScReferenceExpressionImpl.org$jetbrains$plugins$scala$lang$psi$impl$expr$ScReferenceExpressionImpl$$_resolve(ScReferenceExpressionImpl.scala:140)
at org.jetbrains.plugins.scala.lang.psi.impl.expr.ScReferenceExpressionImpl.getSameNameVariants(ScReferenceExpressionImpl.scala:61)
at org.jetbrains.plugins.scala.lang.parameterInfo.ScalaFunctionParameterInfoHandler.findCall(ScalaParameterInfoHandler.scala:300)
at org.jetbrains.plugins.scala.lang.parameterInfo.ScalaFunctionParameterInfoHandler.findElementForParameterInfo(ScalaParameterInfoHandler.scala:63)
at org.jetbrains.plugins.scala.lang.parameterInfo.ScalaFunctionParameterInfoHandler.findElementForParameterInfo(ScalaParameterInfoHandler.scala:42)
at com.intellij.codeInsight.hint.ShowParameterInfoHandler.invoke(ShowParameterInfoHandler.java:21)
at com.intellij.codeInsight.AutoPopupController$6.run(AutoPopupController.java:1)
at com.intellij.util.Alarm$Request$1.run(Alarm.java:222)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:16)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at com.intellij.ide.IdeEventQueue.c(IdeEventQueue.java:35)
at com.intellij.ide.IdeEventQueue.b(IdeEventQueue.java:99)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:217)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)



8 comments
Comment actions Permalink

As I this stacktrace it's not just on launching, it's after opening editor? And for freezing you mean slow typing?
For now I can suggest to add more memory. You can do it in file idea.exe.vmoptions in IDEA bin directory.
But scala-plugin has few critical performance problems. I hope to fix it in Maia next version (just to little improve), not sure about next Diana versions, but also I hope for it

Best regards,
Alexander Podkhalyuzin.

0
Comment actions Permalink

When I say "freezing" I don't mean slow typing: I mean that the whole of IDEA is hung indefinitely and must be manually killed. As you can see from the stack, the event dispatch thread is waiting on some lock - presumably nothing is releasing the lock. If the EDT is hung, the whole IDEA is hung.

This got to the stage where it was happening on launch, hence the only workaround being a complete re-install of IDEA. I have now moved back to the previous version of the plugin and the issue has gone away.

0
Comment actions Permalink

Yes, I see lock, and I'll fix it. I'm sorry for this problems, it was way to improve performance (to cache type system), which is real headache. But as we know now from you, this caching must be more careful. Thank you for your patient.

Best regards,
Alexander Podkhalyuzin.

0
Comment actions Permalink

This might be the problem I'm having as well:

http://www.jetbrains.net/jira/browse/SCL-1295

Thanks, Paul...

0
Comment actions Permalink

I added fix to both versions (Maia and Diana). Maia version I uploaded just few minutes ago, Diana version will be available this monday, I just want to add some bugfixes from Maia version to Diana.
This fix removes deadlock, but it can create SOE (which is better than deadlock), I hope that it will not.

Best regards,
Alexander Podkhalyuzin.

0
Comment actions Permalink

Do I need IntelliJ v9 for the Maia plugin?

0
Comment actions Permalink

Yes, you need last Maia EAP build: http://www.jetbrains.net/confluence/display/IDEADEV/Maia+EAP
Using Maia EAP is better for using scala plugin (scala plugin has more working on Maia version), even Maia EAP is less stable then Diana 8.1.3 (but Maia has few very impressive features).
But I'll upload new version for Diana today.

Best regards,
Alexander Podkhalyuzin

0
Comment actions Permalink

I can add now one more thing.
1. Current Diana plugin version almost final, just some bugfixes can be integrated to it.
2. Current Maia version supports for both versions of scala compiler (2.7 and 2.8), but new 2.8 nested packages ideology force us to support only 2.8 compiler. From now using 2.7 compiler has problems for using short imports (which will be red). So from next plugin versions you can use 2.7 compiler after changing all imports according to 2.8 compiler (autoimport will work in right way for 2.8), or to not update or to use 2.8 compiler.

Sorry for such inconveniences.

P.S. Diana plugin with possible IDEA hang fix uploaded recently.

Best regards,
Alexander Podkhalyuzin

0

Please sign in to leave a comment.