Skip to content

Fix regression for using Scala IDE on scala-library #3502

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 10, 2014

Conversation

retronym
Copy link
Member

Review by @dragos

retronym and others added 2 commits February 10, 2014 17:18
This reverts commit 6690455.

Conflicts:
    src/reflect/scala/reflect/internal/TreeInfo.scala

As evidenced by the highlights of the stack trace in Scala IDE,
my assertion in the 6690455 wasn't universally true.

The change was only motivated by removing a special case, not in
order to fix some other problem. So the revert is the most straight
forward course of action for now.

I haven't pinned this down with a test outside of Eclipse, and
given the lateness of the hour wrt 2.11.0, I'll have to submit
without one.

    2013-03-10 08:38:04,690 ERROR [main] - org.scala-ide.sdt.core - org.scala-ide.sdt.core - org.scala-ide.sdt.core - 0 - Error during askOption
    scala.reflect.internal.Symbols$CyclicReference: illegal cyclic reference involving object Predef
    ...
    at scala.reflect.internal.Symbols$Symbol.lock(Symbols.scala:482)
    at scala.reflect.internal.Symbols$Symbol.info(Symbols.scala:1216)
    at scala.reflect.internal.Symbols$Symbol.tpe(Symbols.scala:1200)
    at scala.reflect.internal.Symbols$Symbol.tpeHK(Symbols.scala:1201)
    at scala.reflect.internal.Types$Type.computeMemberType(Types.scala:784)
    at scala.reflect.internal.Types$Type.memberType(Types.scala:781)
    at scala.reflect.internal.TreeGen.mkAttributedSelect(TreeGen.scala:203)
    ...
    at scala.reflect.internal.TreeGen.mkAttributedStableRef(TreeGen.scala:162)
    at scala.tools.nsc.ast.TreeGen.mkWildcardImport(TreeGen.scala:39)
    at scala.tools.nsc.typechecker.Contexts$Context.makeNewImport(Contexts.scala:308)
    at scala.tools.nsc.typechecker.Contexts$class.rootContext(Contexts.scala:69)
    at scala.tools.nsc.Global$$anon$1.rootContext(Global.scala:492)
    at scala.tools.nsc.typechecker.Contexts$class.rootContext(Contexts.scala:64)
    at scala.tools.nsc.Global$$anon$1.rootContext(Global.scala:492)
    at scala.tools.nsc.typechecker.Analyzer$namerFactory$$anon$1.apply(Analyzer.scala:43)
    at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:463)
    ...
    at scala.tools.nsc.Global$Run.compileLate(Global.scala:1681)
    at scala.tools.nsc.Global$Run.compileLate(Global.scala:1671)
    at scala.tools.nsc.symtab.SymbolLoaders$SourcefileLoader.doComplete(SymbolLoaders.scala:284)
    at scala.tools.nsc.symtab.SymbolLoaders$SymbolLoader.complete(SymbolLoaders.scala:187)
    at scala.reflect.internal.Symbols$Symbol.info(Symbols.scala:1229)
    at scala.reflect.internal.Symbols$Symbol.tpe(Symbols.scala:1200)
    at scala.reflect.internal.Symbols$Symbol.tpeHK(Symbols.scala:1201)
    at scala.reflect.internal.Types$Type.computeMemberType(Types.scala:784)
    at scala.reflect.internal.Types$Type.memberType(Types.scala:781)
    at scala.reflect.internal.TreeGen.mkAttributedSelect(TreeGen.scala:203)
    at scala.reflect.internal.TreeGen.mkAttributedRef(TreeGen.scala:124)
    at scala.reflect.internal.TreeGen.mkAttributedRef(TreeGen.scala:130)
    at scala.reflect.internal.TreeGen.mkAttributedStableRef(TreeGen.scala:162)
    at scala.tools.nsc.ast.TreeGen.mkWildcardImport(TreeGen.scala:39)
    ...
    at scala.tools.nsc.Global$$anon$1.rootContext(Global.scala:492)
    at scala.tools.nsc.typechecker.Analyzer$namerFactory$$anon$1.apply(Analyzer.scala:43)
    at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:463)
    ...
    at scala.tools.nsc.Global$Run.compileLate(Global.scala:1671)
    at scala.tools.nsc.symtab.SymbolLoaders$SourcefileLoader.doComplete(SymbolLoaders.scala:284)
    at scala.tools.nsc.symtab.SymbolLoaders$SymbolLoader.complete(SymbolLoaders.scala:187)
    at scala.reflect.internal.Symbols$Symbol.info(Symbols.scala:1229)
    at scala.reflect.internal.Symbols$Symbol.initialize(Symbols.scala:1365)
    ...
    at scala.collection.immutable.HashSet$HashSet1.foreach(HashSet.scala:153)
    at scala.collection.immutable.HashSet$HashTrieSet.foreach(HashSet.scala:306)
    at scala.tools.eclipse.javaelements.ScalaJavaMapper$class.initializeRequiredSymbols(ScalaJavaMapper.scala:29)
    ...
    at scala.tools.nsc.util.InterruptReq.execute(InterruptReq.scala:26)
    at scala.tools.nsc.interactive.Global.pollForWork(Global.scala:340)
If the class path is incomplete, the presentation compiler might crash during construction.
If the PC thread was already started, it will never get the chance to shutdown, and the
thread leaks. In the IDE, where the PC is started when needed, this can lead to a very
quick depletion of JVM threads.

See Scala IDE #1002016.
@retronym
Copy link
Member Author

/cc @gkossakowski

@retronym retronym added this to the 2.11.0-RC1 milestone Feb 10, 2014
@dragos
Copy link
Contributor

dragos commented Feb 10, 2014

LGTM. Thanks for the quick fix!

gkossakowski added a commit that referenced this pull request Feb 10, 2014
Fix regression for using Scala IDE on scala-library
@gkossakowski gkossakowski merged commit c611f7b into scala:master Feb 10, 2014
@gkossakowski
Copy link
Contributor

Thanks a lot @retronym!

@kiritsuku
Copy link
Contributor

Thanks!

@lrytz
Copy link
Member

lrytz commented Feb 11, 2014

thank you!

@huitseeker
Copy link
Contributor

TY ! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants