Scala 2.9.0.RC2 compiler hangs forever or is extremely slow

64 views
Skip to first unread message

Piotr Kołaczkowski

unread,
Apr 27, 2011, 3:09:41 AM4/27/11
to scala...@googlegroups.com
Hi,

I've got a project that compiles fine with Scala 2.9.0.RC1 - it takes
about 54 seconds with SBT to rebuild fully. I've just upgraded to
2.9.0.RC2 and can't compile it. After 5 minutes it is still compiling,
CPU usage is 100% of one core, memory usage reported by the task manager
is about 600 MB. This happens both in SBT and in IntelliJ Idea.

Tried increasing the heap size for the compiler to 1M, stack size to 2M
- all without effect.

How to debug it? How to find the piece of code that causes this?

BTW: IntelliJ Idea shows "Loaded file BoxesRunTime.class" in its status
line. This text remains there forever - actually for the time I write
this email it is still there. Usually these texts "Loaded file..." are
switched very fast one after another - usually not longer than for 2-3
seconds each.

Regards,
Piotr

Jason Zaugg

unread,
Apr 27, 2011, 3:29:36 AM4/27/11
to Piotr Kołaczkowski, scala...@googlegroups.com
2011/4/27 Piotr Kołaczkowski <pkol...@elka.pw.edu.pl>:

> How to debug it? How to find the piece of code that causes this?

Here's how I go about it.

Use JVisualVM [1] or jstack to find what section of the compiler code
is running. You could post message back here with a link to the thread
dump.

Search Trac and Mailing Lists to see if it's a known problem.

Next, reproduce the problem with the command line scalac. In SBT, run
;debug;compile to see the command line.

Enable extra command line options to increase the verbosity of the
compiler: -verbose -Ydebug -Ylog:all. This will hint at which file is
causing the problem.

Try to isolate that file from the rest of your code step by step.

1. Copy the file, and rename all the top level definitions.
2. Add the new file to the scalac command line (ahead of the original
file), recompile. Hopefully things will now hang while compiling the
the copy.
3. Remove method bodies one-by-one from the copied file (replace with
error("")), recompiling to make sure it still hangs.
4. Remove references to other classes in your project one by one, if
needed you can stub them out with a local definition.

-jason

[1] http://download.oracle.com/javase/6/docs/technotes/tools/share/jvisualvm.html

Piotr Kołaczkowski

unread,
Apr 27, 2011, 3:41:08 AM4/27/11
to scala...@googlegroups.com
Ok, thanks a lot - I'll check that. Till now I'm pretty sure it is not
a JVM problem - both on JDK 6u24 and JDK 7 b158 I encounter the same
behaviour.

Regards,
Piotr

W dniu 2011-04-27 09:29, Jason Zaugg pisze:

Trond Olsen

unread,
Apr 27, 2011, 6:03:16 AM4/27/11
to Piotr Kołaczkowski, scala...@googlegroups.com
My project also get into an "infinite compile" but in 2.9.0.RC1 during typing. It might be related to @specialized and/or access modifiers which are enforced stricter in 2.9.0. I didn't look further besides bug report a bug on @specialized [1].

[1] https://lampsvn.epfl.ch/trac/scala/ticket/4417

2011/4/27 Piotr Kołaczkowski <pkol...@elka.pw.edu.pl>

martin odersky

unread,
Apr 27, 2011, 8:30:47 AM4/27/11
to Piotr Kołaczkowski, scala...@googlegroups.com
Yes, it would be very important to have a thread dump to see where it is stuck.

Thanks

 -- Martin

2011/4/27 Piotr Kołaczkowski <pkol...@elka.pw.edu.pl>



--
----------------------------------------------
Martin Odersky
Prof., EPFL and CEO, Scala Solutions
PSED, 1015 Lausanne, Switzerland


Piotr Kołaczkowski

unread,
Apr 27, 2011, 3:58:37 PM4/27/11
to scala...@googlegroups.com
W dniu 2011-04-27 14:30, martin odersky pisze:

> Yes, it would be very important to have a thread dump to see where it is
> stuck.

Ok, so I've got the thread dump. I've made it several times and it seems
to be always the same (at least the top of it). Hope this helps:


"main" prio=6 tid=0x00199c00 nid=0x1734 runnable [0x00171000]
java.lang.Thread.State: RUNNABLE
at
scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:60)
at scala.collection.immutable.List.foreach(List.scala:45)
at
scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:30)
at scala.collection.mutable.ListBuffer.foreach(ListBuffer.scala:42)
at scala.tools.nsc.backend.icode.Members$Code.touched_$eq(Members.scala:46)
at scala.tools.nsc.backend.icode.Members$Code.newBlock(Members.scala:85)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase$Context.newBlock(GenICode.scala:1990)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.genPrimitiveOp(GenICode.scala:439)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:902)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadIf(GenICode.scala:374)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:665)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.default$2(GenICode.scala:1489)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.genCond(GenICode.scala:1532)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadIf(GenICode.scala:357)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:665)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:1053)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadIf(GenICode.scala:373)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:665)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:1053)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadIf(GenICode.scala:373)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:665)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadIf(GenICode.scala:374)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:665)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:1053)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadIf(GenICode.scala:373)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:665)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadIf(GenICode.scala:374)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:665)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:1053)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadIf(GenICode.scala:373)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:665)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:1053)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadIf(GenICode.scala:373)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:665)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:1053)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadIf(GenICode.scala:373)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:665)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadIf(GenICode.scala:374)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:665)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:1053)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadIf(GenICode.scala:373)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:665)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:1053)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadIf(GenICode.scala:373)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:665)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:1053)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadIf(GenICode.scala:373)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:665)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:1053)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadIf(GenICode.scala:373)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:665)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:1053)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadIf(GenICode.scala:373)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:665)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadIf(GenICode.scala:374)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:665)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:1053)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadIf(GenICode.scala:373)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:665)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:1053)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadIf(GenICode.scala:373)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:665)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadIf(GenICode.scala:374)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:665)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:1053)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadIf(GenICode.scala:373)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:665)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:1053)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadIf(GenICode.scala:373)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:665)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadIf(GenICode.scala:374)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:665)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:1053)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadIf(GenICode.scala:373)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:665)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:1053)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadIf(GenICode.scala:373)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:665)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:1053)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadIf(GenICode.scala:373)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:665)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:1053)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadIf(GenICode.scala:373)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:665)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:1053)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadIf(GenICode.scala:373)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:665)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:1053)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadIf(GenICode.scala:373)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:665)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:1053)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:114)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$gen$1.apply(GenICode.scala:69)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$gen$1.apply(GenICode.scala:69)
at
scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
at scala.collection.immutable.List.foreach(List.scala:45)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:69)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:136)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:88)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$gen$1.apply(GenICode.scala:69)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$gen$1.apply(GenICode.scala:69)
at
scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
at scala.collection.immutable.List.foreach(List.scala:45)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:69)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:79)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:65)
at
scala.tools.nsc.backend.icode.GenICode$ICodePhase.apply(GenICode.scala:61)
at
scala.tools.nsc.Global$GlobalPhase$$anonfun$applyPhase$1.apply(Global.scala:326)
at
scala.tools.nsc.Global$GlobalPhase$$anonfun$applyPhase$1.apply(Global.scala:326)
at scala.tools.nsc.reporters.Reporter.withSource(Reporter.scala:47)
at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:326)
at
scala.tools.nsc.Global$GlobalPhase$$anonfun$run$1.apply(Global.scala:294)
at
scala.tools.nsc.Global$GlobalPhase$$anonfun$run$1.apply(Global.scala:294)
at scala.collection.Iterator$class.foreach(Iterator.scala:653)
at
scala.collection.mutable.ListBuffer$$anon$1.foreach(ListBuffer.scala:311)
at scala.tools.nsc.Global$GlobalPhase.run(Global.scala:294)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.run(GenICode.scala:54)
at scala.tools.nsc.Global$Run.compileSources(Global.scala:949)
at scala.tools.nsc.Global$Run.compile(Global.scala:1034)
at xsbt.CompilerInterface.run(CompilerInterface.scala:82)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at xsbt.AnalyzingCompiler.call(AnalyzingCompiler.scala:40)
at xsbt.AnalyzingCompiler.apply(AnalyzingCompiler.scala:18)
at sbt.Compile.processScala(Compile.scala:76)
at sbt.CompilerCore$$anonfun$1.apply(Compile.scala:27)
at sbt.CompilerCore$$anonfun$1.apply(Compile.scala:27)
at sbt.CompilerCore$$anonfun$process$1$1.apply(Compile.scala:22)
at sbt.CompilerCore$$anonfun$process$1$1.apply(Compile.scala:22)
at sbt.CompilerCore$$anonfun$doCompile$3.apply(Compile.scala:45)
at sbt.CompilerCore$$anonfun$doCompile$3.apply(Compile.scala:42)
at scala.Option.orElse(Option.scala:102)
at sbt.CompilerCore.doCompile(Compile.scala:41)
at sbt.CompilerCore.apply(Compile.scala:29)
at sbt.AbstractCompileConditional.run$1(Conditional.scala:341)
at sbt.AbstractCompileConditional$$anonfun$3.apply(Conditional.scala:344)
at sbt.AbstractCompileConditional$$anonfun$3.apply(Conditional.scala:344)
at sbt.classfile.Analyze$.apply(Analyze.scala:110)
at sbt.AbstractCompileConditional.execute(Conditional.scala:344)
at sbt.Conditional$class.run(Conditional.scala:43)
at sbt.AbstractCompileConditional.run(Conditional.scala:231)
at
sbt.BasicScalaProject.sbt$BasicScalaProject$$doCompile(DefaultProject.scala:260)
at
sbt.BasicScalaProject$$anonfun$compileAction$1.apply(DefaultProject.scala:274)
at
sbt.BasicScalaProject$$anonfun$compileAction$1.apply(DefaultProject.scala:274)
at sbt.TaskManager$Task.invoke(TaskManager.scala:62)
at sbt.impl.RunTask.doRun$1(RunTask.scala:77)
at sbt.impl.RunTask.runTask(RunTask.scala:85)
at sbt.impl.RunTask.run(RunTask.scala:32)
at sbt.impl.RunTask$.apply(RunTask.scala:17)
at sbt.impl.RunTask$.apply(RunTask.scala:16)
at sbt.Project$class.run(Project.scala:98)
at sbt.Project$class.act(Project.scala:129)
at sbt.BasicScalaProject.act(DefaultProject.scala:21)
at sbt.xMain$$anonfun$8.apply(Main.scala:530)
at sbt.xMain$$anonfun$8.apply(Main.scala:530)
at sbt.xMain.withAction(Main.scala:563)
at sbt.xMain.sbt$xMain$$handleAction(Main.scala:530)
at sbt.xMain.handleCommand(Main.scala:520)
at sbt.xMain.processAction(Main.scala:459)
at sbt.xMain.process$1(Main.scala:257)
at sbt.xMain$Continue$1.apply(Main.scala:132)
at sbt.xMain.run$1(Main.scala:136)
at sbt.xMain.processArguments(Main.scala:266)
at sbt.xMain.startProject(Main.scala:107)
at sbt.xMain.run(Main.scala:84)
at sbt.xMain.run0$1(Main.scala:35)
at sbt.xMain.run(Main.scala:42)
at xsbt.boot.Launch$.run(Launch.scala:53)
at xsbt.boot.Launch$$anonfun$explicit$1.apply(Launch.scala:42)
at xsbt.boot.Launch$$anonfun$explicit$1.apply(Launch.scala:42)
at xsbt.boot.Launch$.launch(Launch.scala:57)
at xsbt.boot.Launch$.explicit(Launch.scala:42)
at xsbt.boot.Launch$.initialized(Launch.scala:38)
at xsbt.boot.Launch$.parsed(Launch.scala:31)
at xsbt.boot.Launch$.configured(Launch.scala:21)
at xsbt.boot.Launch$.apply(Launch.scala:16)
at xsbt.boot.Launch$.apply(Launch.scala:13)
at xsbt.boot.Boot$.runImpl(Boot.scala:24)
at xsbt.boot.Boot$.run(Boot.scala:19)
at xsbt.boot.Boot$.main(Boot.scala:15)
at xsbt.boot.Boot.main(Boot.scala)

>
> Thanks
>
> -- Martin
>
> 2011/4/27 Piotr Ko�aczkowski
> <pkol...@elka.pw.edu.pl
> <mailto:pkol...@elka.pw.edu.pl>>


>
> Ok, thanks a lot - I'll check that. Till now I'm pretty sure it is
> not a JVM problem - both on JDK 6u24 and JDK 7 b158 I encounter the
> same behaviour.
>
> Regards,
> Piotr
>
> W dniu 2011-04-27 09:29, Jason Zaugg pisze:
>
> 2011/4/27 Piotr

> Ko�aczkowski<pkol...@elka.pw.edu.pl
> <mailto:pkol...@elka.pw.edu.pl>>:

Piotr Kołaczkowski

unread,
Apr 27, 2011, 4:32:57 PM4/27/11
to scala...@googlegroups.com
I also tried compiling with -verbose -Ydebug and -Ylog:all but now
instead of hanging I get and exception after some time:


[info] [log explicitouter] [183] looking at Select:
pl.ons.numeric.IndexedFunction.fromFunction sym: method fromFunction:
[<deferred> <param
> A,<deferred> <param> B](<param> f: scala.this.Function1[A,B],<param>
key2index: immutable.this.Map[A,scala.this.Int])numeric.this.IndexedF
unction[A,B] [tree.tpe: [<deferred> <param> A,<deferred> <param>
B](<param> f: scala.this.Function1[A,B],<param> key2index: immutable.this.M
ap[A,scala.this.Int])numeric.this.IndexedFunction[A,B]]
[info] [log explicitouter] [183] looking at Select:
pl.ons.numeric.IndexedFunction sym: object IndexedFunction: object
numeric.this.IndexedF
unction [tree.tpe: numeric.this.IndexedFunction.type]
[info] [log explicitouter] [183] looking at Select: pl.ons.numeric sym:
package numeric: package ons.this.numeric [tree.tpe: <root>.this.pl.
ons.numeric.type]
[info] [log explicitouter] [183] looking at Select: pl.ons sym: package
ons: package pl.this.ons [tree.tpe: <root>.this.pl.ons.type]
[info] [log explicitouter] [183] looking at Select: layer.indexOf sym:
value indexOf: ()immutable.this.Map[numeric.this.Var[numeric.this.Rou
ghDouble],scala.this.Int] [tree.tpe:
()immutable.this.Map[numeric.this.Var[numeric.this.RoughDouble],scala.this.Int]]
[info] [log explicitouter] [183] looking at Select: new
numeric.this.StateVector.this(immutable.this.Nil).+: sym: method +::
(<param> item:
scala.this.Tuple2[scala.this.Double,numeric.this.IndexedFunction[numeric.this.Var[numeric.this.RoughDouble],numeric.this.RoughDouble]])numer
ic.this.StateVector [tree.tpe: (<param> item:
scala.this.Tuple2[scala.this.Double,numeric.this.IndexedFunction[numeric.this.Var[numeric.this
.RoughDouble],numeric.this.RoughDouble]])numeric.this.StateVector]
[info] [log explicitouter] [183] looking at Select: new
numeric.this.StateVector.this sym: constructor StateVector: (<param>
data:collection.this.Seq[scala.this.Tuple2[scala.this.Double,numeric.this.IndexedFunction[numeric.this.Var[numeric.this.RoughDouble],numeric.this.RoughDou
ble]]])numeric.this.StateVector [tree.tpe: (<param> data:
collection.this.Seq[scala.this.Tuple2[scala.this.Double,numeric.this.IndexedFuncti
on[numeric.this.Var[numeric.this.RoughDouble],numeric.this.RoughDouble]]])numeric.this.StateVector]
java.lang.UnsupportedOperationException: Position.line
at scala.tools.nsc.util.Position$class.line(Position.scala:173)
at scala.tools.nsc.util.NoPosition$.line(Position.scala:196)
at
scala.tools.nsc.transform.SpecializeTypes$$anon$6$$anonfun$transform$10.apply(SpecializeTypes.scala:1368)
at
scala.tools.nsc.transform.SpecializeTypes$$anon$6$$anonfun$transform$10.apply(SpecializeTypes.scala:1368)
at scala.tools.nsc.Global.log(Global.scala:160)
at
scala.tools.nsc.transform.SpecializeTypes$$anon$6.transform(SpecializeTypes.scala:1368)
at
scala.tools.nsc.ast.Trees$Transformer$$anonfun$transformTrees$1.apply(Trees.scala:867)
at
scala.tools.nsc.ast.Trees$Transformer$$anonfun$transformTrees$1.apply(Trees.scala:867)
at scala.collection.immutable.List.loop$1(List.scala:117)
at scala.collection.immutable.List.mapConserve(List.scala:133)
at
scala.tools.nsc.ast.Trees$Transformer.transformTrees(Trees.scala:867)
at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:831)
at
scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:53)
at
scala.tools.nsc.transform.SpecializeTypes$$anon$6.transform(SpecializeTypes.scala:1332)
at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:839)
at
scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:53)
at
scala.tools.nsc.transform.SpecializeTypes$$anon$6.transform(SpecializeTypes.scala:1403)
at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:831)
at
scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:53)
at
scala.tools.nsc.transform.SpecializeTypes$$anon$6.transform(SpecializeTypes.scala:1545)
at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:793)
at
scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:53)
at
scala.tools.nsc.transform.SpecializeTypes$$anon$6.transform(SpecializeTypes.scala:1545)
at
scala.tools.nsc.ast.Trees$Transformer$$anonfun$transform$4.apply(Trees.scala:771)
at
scala.tools.nsc.ast.Trees$Transformer$$anonfun$transform$4.apply(Trees.scala:770)
at scala.tools.nsc.ast.Trees$Transformer.atOwner(Trees.scala:893)
at
scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:38)
at
scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:31)
at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:769)
at
scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:53)
at
scala.tools.nsc.transform.SpecializeTypes$$anon$6.transform(SpecializeTypes.scala:1545)
at
scala.tools.nsc.ast.Trees$Transformer$$anonfun$transformStats$1.apply(Trees.scala:885)
at
scala.tools.nsc.ast.Trees$Transformer$$anonfun$transformStats$1.apply(Trees.scala:883)
at scala.collection.immutable.List.loop$1(List.scala:117)
at scala.collection.immutable.List.mapConserve(List.scala:133)
at
scala.tools.nsc.ast.Trees$Transformer.transformStats(Trees.scala:883)
at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:793)
at
scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:53)
at
scala.tools.nsc.transform.SpecializeTypes$$anon$6.transform(SpecializeTypes.scala:1545)
at
scala.tools.nsc.ast.Trees$Transformer$$anonfun$transform$5.apply(Trees.scala:777)
at
scala.tools.nsc.ast.Trees$Transformer$$anonfun$transform$5.apply(Trees.scala:775)
at scala.tools.nsc.ast.Trees$Transformer.atOwner(Trees.scala:893)
at
scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:38)
at
scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:31)
at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:774)
at
scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:53)
at
scala.tools.nsc.transform.SpecializeTypes$$anon$6.transform(SpecializeTypes.scala:1545)
at
scala.tools.nsc.ast.Trees$Transformer$$anonfun$transformTrees$1.apply(Trees.scala:867)
at
scala.tools.nsc.ast.Trees$Transformer$$anonfun$transformTrees$1.apply(Trees.scala:867)
at scala.collection.immutable.List.loop$1(List.scala:117)
at scala.collection.immutable.List.mapConserve(List.scala:133)
at
scala.tools.nsc.ast.Trees$Transformer.transformTrees(Trees.scala:867)
at
scala.tools.nsc.transform.SpecializeTypes$$anon$6$$anonfun$transform$15.apply(SpecializeTypes.scala:1423)
at
scala.tools.nsc.transform.SpecializeTypes$$anon$6$$anonfun$transform$15.apply(SpecializeTypes.scala:1423)
at scala.tools.nsc.ast.Trees$Transformer.atOwner(Trees.scala:893)
at
scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:38)
at
scala.tools.nsc.transform.SpecializeTypes$$anon$6.transform(SpecializeTypes.scala:1423)
at
scala.tools.nsc.ast.Trees$Transformer.transformTemplate(Trees.scala:869)
at
scala.tools.nsc.ast.Trees$Transformer$$anonfun$transform$2.apply(Trees.scala:761)
at
scala.tools.nsc.ast.Trees$Transformer$$anonfun$transform$2.apply(Trees.scala:760)
at scala.tools.nsc.ast.Trees$Transformer.atOwner(Trees.scala:893)
at
scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:38)
at
scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:31)
at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:759)
at
scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:53)
at
scala.tools.nsc.transform.SpecializeTypes$$anon$6.transform(SpecializeTypes.scala:1545)
at
scala.tools.nsc.ast.Trees$Transformer$$anonfun$transformStats$1.apply(Trees.scala:885)
at
scala.tools.nsc.ast.Trees$Transformer$$anonfun$transformStats$1.apply(Trees.scala:883)
at scala.collection.immutable.List.loop$1(List.scala:117)
at scala.collection.immutable.List.mapConserve(List.scala:133)
at
scala.tools.nsc.ast.Trees$Transformer.transformStats(Trees.scala:883)
at
scala.tools.nsc.transform.SpecializeTypes$$anon$6$$anonfun$transform$14.apply(SpecializeTypes.scala:1410)
at
scala.tools.nsc.transform.SpecializeTypes$$anon$6$$anonfun$transform$14.apply(SpecializeTypes.scala:1408)
at scala.tools.nsc.ast.Trees$Transformer.atOwner(Trees.scala:893)
at
scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:38)
at
scala.tools.nsc.transform.SpecializeTypes$$anon$6.transform(SpecializeTypes.scala:1408)
at
scala.tools.nsc.transform.SpecializeTypes$SpecializationTransformer$$anonfun$transform$35.apply(SpecializeTypes.s
at
scala.tools.nsc.transform.SpecializeTypes$SpecializationTransformer$$anonfun$transform$35.apply(SpecializeTypes.s
at scala.tools.nsc.symtab.SymbolTable.atPhase(SymbolTable.scala:96)
at
scala.tools.nsc.transform.SpecializeTypes$SpecializationTransformer.transform(SpecializeTypes.scala:1793)
at
scala.tools.nsc.ast.Trees$Transformer.transformUnit(Trees.scala:886)
at
scala.tools.nsc.transform.Transform$Phase.apply(Transform.scala:30)


at
scala.tools.nsc.Global$GlobalPhase$$anonfun$applyPhase$1.apply(Global.scala:326)
at
scala.tools.nsc.Global$GlobalPhase$$anonfun$applyPhase$1.apply(Global.scala:326)
at scala.tools.nsc.reporters.Reporter.withSource(Reporter.scala:47)
at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:326)
at
scala.tools.nsc.Global$GlobalPhase$$anonfun$run$1.apply(Global.scala:294)
at
scala.tools.nsc.Global$GlobalPhase$$anonfun$run$1.apply(Global.scala:294)
at scala.collection.Iterator$class.foreach(Iterator.scala:653)
at
scala.collection.mutable.ListBuffer$$anon$1.foreach(ListBuffer.scala:311)
at scala.tools.nsc.Global$GlobalPhase.run(Global.scala:294)

at sbt.xMain.processArguments(Main.scala:266)
at sbt.xMain.startProject(Main.scala:107)
at sbt.xMain.run(Main.scala:84)
at sbt.xMain.run0$1(Main.scala:35)
at sbt.xMain.run(Main.scala:42)
at xsbt.boot.Launch$.run(Launch.scala:53)
at xsbt.boot.Launch$$anonfun$explicit$1.apply(Launch.scala:42)
at xsbt.boot.Launch$$anonfun$explicit$1.apply(Launch.scala:42)
at xsbt.boot.Launch$.launch(Launch.scala:57)
at xsbt.boot.Launch$.explicit(Launch.scala:42)
at xsbt.boot.Launch$.initialized(Launch.scala:38)
at xsbt.boot.Launch$.parsed(Launch.scala:31)
at xsbt.boot.Launch$.configured(Launch.scala:21)
at xsbt.boot.Launch$.apply(Launch.scala:16)
at xsbt.boot.Launch$.apply(Launch.scala:13)
at xsbt.boot.Boot$.runImpl(Boot.scala:24)
at xsbt.boot.Boot$.run(Boot.scala:19)
at xsbt.boot.Boot$.main(Boot.scala:15)
at xsbt.boot.Boot.main(Boot.scala)


Regards,
Piotr


W dniu 2011-04-27 21:58, Piotr Ko�aczkowski pisze:

martin odersky

unread,
Apr 27, 2011, 4:50:42 PM4/27/11
to Piotr Kołaczkowski, scala...@googlegroups.com, iulian dragos
Thanks, that should help. We'll have a look at it.

-- Martin

2011/4/27 Piotr Kołaczkowski <pkol...@elka.pw.edu.pl>
W dniu 2011-04-27 14:30, martin odersky pisze:

Thanks

 -- Martin

2011/4/27 Piotr Kołaczkowski
<pkol...@elka.pw.edu.pl
<mailto:pkol...@elka.pw.edu.pl>>


   Ok, thanks a lot - I'll check that. Till now I'm pretty sure it is
   not a JVM problem - both on JDK 6u24 and JDK 7 b158 I encounter the
   same behaviour.

   Regards,
   Piotr

   W dniu 2011-04-27 09:29, Jason Zaugg pisze:

       2011/4/27 Piotr
       Kołaczkowski<pkol...@elka.pw.edu.pl

Paul Phillips

unread,
Apr 27, 2011, 6:53:14 PM4/27/11
to Piotr Kołaczkowski, scala...@googlegroups.com
On 4/27/11 12:58 PM, Piotr Ko�aczkowski wrote:
> scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:665)
>
> at
> scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:1053)
>
> at
> scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadIf(GenICode.scala:373)
>
> at
> scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:665)
>
> at
> scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadIf(GenICode.scala:374)
>
> at
> scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:665)
>
> at
> scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:1053)


Aaaaaaaaaaaaaaagh, I enjoyed this loop for a while a couple days ago but
I thought then and until now it was a consequence of the code I was
developing at the time. I ended up giving up on what I was doing
because I couldn't figure out how I was inducing this. Oh, compiler
development, why do you mock me so.

Paul Phillips

unread,
Apr 27, 2011, 7:32:59 PM4/27/11
to Piotr Kołaczkowski, scala-user
On 4/27/11 1:32 PM, Piotr Ko�aczkowski wrote:
> I also tried compiling with -verbose -Ydebug and -Ylog:all but now
> instead of hanging I get and exception after some time:

Unfortunately it is more often than not the case that those options in
combination are influential on the compilation process. It's been a
long time since you could give all three and reasonably expect the same
outcome as you had without.

I am probably responsible for whatever is happening in genicode but you
have me in a very difficult position with no code. Do you have anything
you can give me? Otherwise you are sentenced to hover over trunk trying
each new commit.

Piotr Kołaczkowski

unread,
Apr 28, 2011, 1:58:38 AM4/28/11
to scala...@googlegroups.com, Piotr Kołaczkowski, scala-user
W dniu 2011-04-28 01:32, Paul Phillips pisze:

> On 4/27/11 1:32 PM, Piotr Ko�aczkowski wrote:
>> I also tried compiling with -verbose -Ydebug and -Ylog:all but now
>> instead of hanging I get and exception after some time:
>
> Unfortunately it is more often than not the case that those options in
> combination are influential on the compilation process. It's been a
> long time since you could give all three and reasonably expect the same
> outcome as you had without.

Oh, I didn't expect this - this is a very valuable info.

>
> I am probably responsible for whatever is happening in genicode but you
> have me in a very difficult position with no code. Do you have anything
> you can give me? Otherwise you are sentenced to hover over trunk trying
> each new commit.


I know, really. I'm working hard on this today. I posted the stacktraces
yesterday because it was the "easy" part so I didn't want you to wait
until I have some more useful information which is much harder to get (I
mean the few lines of code that cause this). My project is 700+ classes
large, so this may take some time.

Regards,
Piotr

Piotr Kołaczkowski

unread,
Apr 28, 2011, 2:28:01 AM4/28/11
to scala...@googlegroups.com, public-scala-user-/J...@lo.gmane.org, Piotr Kołaczkowski, scala-user
W dniu 2011-04-28 07:58, Piotr Ko�aczkowski pisze:

Ok, so using only -verbose helped to find the culprit class:
...
[info] [Generating icode for Complex.scala]
[info] [Generating icode for DiffScheme.scala]
[info] [Generating icode for DiffSolver.scala]
[info] [Generating icode for Equation.scala]
[info] [Generating icode for EquationSimplifier.sca
[info] [Generating icode for EquationSolver.scala]
[info] [Generating icode for EquationSystem.scala]
[info] [Generating icode for ExplicitSolver.scala]
[info] [Generating icode for Expr.scala]
(and here it hangs)

I'll keep in touch ;)

BTW: Before it hangs this caught my eye:
[info] [explicitouter in 154378ms]

Something must have changed for much worse with performance because in
2.9.RC1 the log is:
[info] [explicitouter in 3963ms]

Now, this will be hard to debug... :(

Regards,
Piotr

Paul Phillips

unread,
Apr 28, 2011, 3:35:46 AM4/28/11
to Piotr Kołaczkowski, scala-user
On 4/27/11 11:28 PM, Piotr Ko�aczkowski wrote:
> BTW: Before it hangs this caught my eye:
> [info] [explicitouter in 154378ms]
>
> Something must have changed for much worse with performance because in
> 2.9.RC1 the log is:
> [info] [explicitouter in 3963ms]

This is enough to confirm my suspicion that it's the pattern matcher.
Don't knock yourself out, since that pretty much tells me what I need.
Do you have decent sized sequence matches, like

foo match {
case List(x, y, z, q) => ..
// or maybe
case x :: y :: _ => ...
}

Because if you do, try changing those, as I predict they are the
instigators.

Piotr Kołaczkowski

unread,
Apr 28, 2011, 4:41:08 AM4/28/11
to scala...@googlegroups.com, Piotr Kołaczkowski, scala-user
W dniu 2011-04-28 09:35, Paul Phillips pisze:


I opened a ticket for it: #4523

Regards,
Piotr

Reply all
Reply to author
Forward
0 new messages