Aladdin - Scala Bugtracking
[#830] project: compiler priority: medium category: bug
submitter assigned to status date submitted
Sean Martin fixed 2006-11-17 21:47:03.0
subject "cursed 13" resident compiler crash (build 9270).
code
// See test/pending/res/bug830[A/B].res
// two files
// test/Good.scala
package test;
trait HasNodeXXX {
  type Node <: NodeImpl;
  trait NodeImpl;
}
trait ScalaFlowScannerZZZ extends HasNodeXXX {
  type Node <: NodeImpl;
  trait NodeImplA extends super.NodeImpl;
  trait NodeImplB extends super.NodeImpl;
  trait NodeImpl extends NodeImplA with NodeImplB;
}
// test/Bad.scala
package test;
trait HasNodeXXX {
  type Node <: NodeImpl;
  trait NodeImpl;
}
trait ScalaFlowScannerZZZ extends HasNodeXXX { 
  type Node <: NodeImpl;
  trait NodeImplA extends super.NodeImpl;
  trait NodeImplB extends NodeImpl;
  trait NodeImpl extends NodeImplA with NodeImplB;
}
what happened
Note: this is kind of a stress test, but I run into this bug enough that it would be really nice to fix. Run the\
 resident compiler and compile Good.scala and Bad.scala an equal number of times for a total of 12 where Bad.sca\
la should be the 12th file compiled. The 13th file compiled should be Good.scala. Tran5cr1p7-haX0Rs as follows. First \
the one-one alternating version:

sean-mcdirmid:~/workspace/test34/src mcdirmid$ ../../scala/build/quick/bin/scalac -resident -d ../bin/ -sou\
rcepath .

nsc> test/Good.scala

nsc> test/Bad.scala
test/Bad.scala:7 error: illegal cyclic reference involving trait NodeImpl
  type Node <: NodeImpl;
       ^
test/Bad.scala:9 error: illegal cyclic reference involving trait NodeImplB
  trait NodeImplB extends NodeImpl;
  ^
test/Bad.scala:10 error: illegal cyclic reference involving trait NodeImpl
  trait NodeImpl extends NodeImplA with NodeImplB;
  ^

nsc> test/Good.scala

nsc> test/Bad.scala
test/Bad.scala:7 error: illegal cyclic reference involving trait NodeImpl
  type Node <: NodeImpl;
       ^
test/Bad.scala:9 error: illegal cyclic reference involving trait NodeImplB
  trait NodeImplB extends NodeImpl;
  ^
test/Bad.scala:10 error: illegal cyclic reference involving trait NodeImpl
  trait NodeImpl extends NodeImplA with NodeImplB;
  ^

nsc> test/Good.scala

nsc> test/Bad.scala
test/Bad.scala:7 error: illegal cyclic reference involving trait NodeImpl
  type Node <: NodeImpl;
       ^
test/Bad.scala:9 error: illegal cyclic reference involving trait NodeImplB
  trait NodeImplB extends NodeImpl;
  ^
test/Bad.scala:10 error: illegal cyclic reference involving trait NodeImpl
  trait NodeImpl extends NodeImplA with NodeImplB;
  ^

nsc> test/Good.scala

nsc> test/Bad.scala
test/Bad.scala:7 error: illegal cyclic reference involving trait NodeImpl
  type Node <: NodeImpl;
       ^
test/Bad.scala:9 error: illegal cyclic reference involving trait NodeImplB
  trait NodeImplB extends NodeImpl;
  ^
test/Bad.scala:10 error: illegal cyclic reference involving trait NodeImpl
  trait NodeImpl extends NodeImplA with NodeImplB;
  ^

nsc> test/Good.scala

nsc> test/Bad.scala
test/Bad.scala:7 error: illegal cyclic reference involving trait NodeImpl
  type Node <: NodeImpl;
       ^
test/Bad.scala:9 error: illegal cyclic reference involving trait NodeImplB
  trait NodeImplB extends NodeImpl;
  ^
test/Bad.scala:10 error: illegal cyclic reference involving trait NodeImpl
  trait NodeImpl extends NodeImplA with NodeImplB;
  ^

nsc> test/Good.scala

nsc> test/Bad.scala
test/Bad.scala:7 error: illegal cyclic reference involving trait NodeImpl
  type Node <: NodeImpl;
       ^
test/Bad.scala:9 error: illegal cyclic reference involving trait NodeImplB
  trait NodeImplB extends NodeImpl;
  ^
test/Bad.scala:10 error: illegal cyclic reference involving trait NodeImpl
  trait NodeImpl extends NodeImplA with NodeImplB;
  ^

nsc> test/Good.scala
Exception in thread "main" java.lang.Error: recursive <:<
	at scala.tools.nsc.symtab.Types$class.isSubType(Types.scala:1823)
	at scala.tools.nsc.symtab.SymbolTable.isSubType(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$Type.$less$colon$less(Types.scala:266)
	at scala.tools.nsc.symtab.Types$class.isSubType0(Types.scala:1875)
	at scala.tools.nsc.symtab.SymbolTable.isSubType0(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$class.isSubType(Types.scala:1824)
	at scala.tools.nsc.symtab.SymbolTable.isSubType(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$Type.$less$colon$less(Types.scala:266)
	at scala.tools.nsc.typechecker.Typers$Typer.typedAbsTypeDef(Typers.scala:1073)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1863)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:2228)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:2260)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStat$0(Typers.scala:1270)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$48.apply(Typers.scala:1291)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$48.apply(Typers.scala:1291)
	at scala.List$.loop$0(List.scala:244)
	at scala.List$.mapConserve(List.scala:261)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:1291)
	at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:917)
	at scala.tools.nsc.typechecker.Typers$Typer.typedClassDef(Typers.scala:827)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1851)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:2228)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:2260)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStat$0(Typers.scala:1270)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$48.apply(Typers.scala:1291)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$48.apply(Typers.scala:1291)
	at scala.List$.loop$0(List.scala:244)
	at scala.List$.mapConserve(List.scala:261)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:1291)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1847)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:2228)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:2260)
	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$1.apply(Analyzer.scala:38)
	at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:220)
	at scala.tools.nsc.Global$GlobalPhase$$anonfun$1.apply(Global.scala:209)
	at scala.tools.nsc.Global$GlobalPhase$$anonfun$1.apply(Global.scala:209)
	at scala.Iterator$class.foreach(Iterator.scala:341)
	at scala.collection.mutable.ListBuffer$$anon$0.foreach(ListBuffer.scala:244)
	at scala.tools.nsc.Global$GlobalPhase.run(Global.scala:209)
	at scala.tools.nsc.Global$Run.compileSources(Global.scala:474)
	at scala.tools.nsc.Global$Run.compile(Global.scala:543)
	at scala.tools.nsc.Main$$anonfun$0.apply(Main.scala:37)
	at scala.tools.nsc.Main$$anonfun$0.apply(Main.scala:34)
	at scala.tools.nsc.EvalLoop$class.loop(EvalLoop.scala:17)
	at scala.tools.nsc.Main$.loop(Main.scala:17)
	at scala.tools.nsc.EvalLoop$class.loop(EvalLoop.scala:18)
	at scala.tools.nsc.Main$.loop(Main.scala:17)
	at scala.tools.nsc.EvalLoop$class.loop(EvalLoop.scala:18)
	at scala.tools.nsc.Main$.loop(Main.scala:17)
	at scala.tools.nsc.EvalLoop$class.loop(EvalLoop.scala:18)
	at scala.tools.nsc.Main$.loop(Main.scala:17)
	at scala.tools.nsc.EvalLoop$class.loop(EvalLoop.scala:18)
	at scala.tools.nsc.Main$.loop(Main.scala:17)
	at scala.tools.nsc.EvalLoop$class.loop(EvalLoop.scala:18)
	at scala.tools.nsc.Main$.loop(Main.scala:17)
	at scala.tools.nsc.EvalLoop$class.loop(EvalLoop.scala:18)
	at scala.tools.nsc.Main$.loop(Main.scala:17)
	at scala.tools.nsc.EvalLoop$class.loop(EvalLoop.scala:18)
	at scala.tools.nsc.Main$.loop(Main.scala:17)
	at scala.tools.nsc.EvalLoop$class.loop(EvalLoop.scala:18)
	at scala.tools.nsc.Main$.loop(Main.scala:17)
	at scala.tools.nsc.EvalLoop$class.loop(EvalLoop.scala:18)
	at scala.tools.nsc.Main$.loop(Main.scala:17)
	at scala.tools.nsc.EvalLoop$class.loop(EvalLoop.scala:18)
	at scala.tools.nsc.Main$.loop(Main.scala:17)
	at scala.tools.nsc.EvalLoop$class.loop(EvalLoop.scala:18)
	at scala.tools.nsc.Main$.loop(Main.scala:17)
	at scala.tools.nsc.EvalLoop$class.loop(EvalLoop.scala:18)
	at scala.tools.nsc.Main$.loop(Main.scala:17)
	at scala.tools.nsc.Main$.resident(Main.scala:34)
	at scala.tools.nsc.Main$.process(Main.scala:69)
	at scala.tools.nsc.Main$.main(Main.scala:96)
	at scala.tools.nsc.Main.main(Main.scala)
sean-mcdirmid:~/workspace/test34/src mcdirmid$ 
And now the three-three alternating version:
sean-mcdirmid:~/workspace/test34/src mcdirmid$ ../../scala/build/quick/bin/scalac -resident -d ../bin/ -sou\
rcepath .

nsc> test/Good.scala

nsc> test/Good.scala

nsc> test/Good.scala

nsc> test/Bad.scala
test/Bad.scala:7 error: illegal cyclic reference involving trait NodeImpl
  type Node <: NodeImpl;
       ^
test/Bad.scala:9 error: illegal cyclic reference involving trait NodeImplB
  trait NodeImplB extends NodeImpl;
  ^
test/Bad.scala:10 error: illegal cyclic reference involving trait NodeImpl
  trait NodeImpl extends NodeImplA with NodeImplB;
  ^

nsc> test/Bad.scala
test/Bad.scala:7 error: illegal cyclic reference involving trait NodeImpl
  type Node <: NodeImpl;
       ^
test/Bad.scala:9 error: illegal cyclic reference involving trait NodeImplB
  trait NodeImplB extends NodeImpl;
  ^
test/Bad.scala:10 error: illegal cyclic reference involving trait NodeImpl
  trait NodeImpl extends NodeImplA with NodeImplB;
  ^

nsc> test/Bad.scala
test/Bad.scala:7 error: illegal cyclic reference involving trait NodeImpl
  type Node <: NodeImpl;
       ^
test/Bad.scala:9 error: illegal cyclic reference involving trait NodeImplB
  trait NodeImplB extends NodeImpl;
  ^
test/Bad.scala:10 error: illegal cyclic reference involving trait NodeImpl
  trait NodeImpl extends NodeImplA with NodeImplB;
  ^

nsc> test/Good.scala

nsc> test/Good.scala

nsc> test/Good.scala

nsc> test/Bad.scala
test/Bad.scala:7 error: illegal cyclic reference involving trait NodeImpl
  type Node <: NodeImpl;
       ^
test/Bad.scala:9 error: illegal cyclic reference involving trait NodeImplB
  trait NodeImplB extends NodeImpl;
  ^
test/Bad.scala:10 error: illegal cyclic reference involving trait NodeImpl
  trait NodeImpl extends NodeImplA with NodeImplB;
  ^

nsc> test/Bad.scala
test/Bad.scala:7 error: illegal cyclic reference involving trait NodeImpl
  type Node <: NodeImpl;
       ^
test/Bad.scala:9 error: illegal cyclic reference involving trait NodeImplB
  trait NodeImplB extends NodeImpl;
  ^
test/Bad.scala:10 error: illegal cyclic reference involving trait NodeImpl
  trait NodeImpl extends NodeImplA with NodeImplB;
  ^

nsc> test/Bad.scala
test/Bad.scala:7 error: illegal cyclic reference involving trait NodeImpl
  type Node <: NodeImpl;
       ^
test/Bad.scala:9 error: illegal cyclic reference involving trait NodeImplB
  trait NodeImplB extends NodeImpl;
  ^
test/Bad.scala:10 error: illegal cyclic reference involving trait NodeImpl
  trait NodeImpl extends NodeImplA with NodeImplB;
  ^

nsc> test/Good.scala
Exception in thread "main" java.lang.Error: recursive <:<
	at scala.tools.nsc.symtab.Types$class.isSubType(Types.scala:1823)
	at scala.tools.nsc.symtab.SymbolTable.isSubType(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$Type.$less$colon$less(Types.scala:266)
	at scala.tools.nsc.symtab.Types$class.isSubType0(Types.scala:1875)
	at scala.tools.nsc.symtab.SymbolTable.isSubType0(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$class.isSubType(Types.scala:1824)
	at scala.tools.nsc.symtab.SymbolTable.isSubType(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$Type.$less$colon$less(Types.scala:266)
	at scala.tools.nsc.typechecker.Typers$Typer.typedAbsTypeDef(Typers.scala:1073)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1863)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:2228)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:2260)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStat$0(Typers.scala:1270)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$48.apply(Typers.scala:1291)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$48.apply(Typers.scala:1291)
	at scala.List$.loop$0(List.scala:244)
	at scala.List$.mapConserve(List.scala:261)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:1291)
	at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:917)
	at scala.tools.nsc.typechecker.Typers$Typer.typedClassDef(Typers.scala:827)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1851)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:2228)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:2260)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStat$0(Typers.scala:1270)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$48.apply(Typers.scala:1291)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$48.apply(Typers.scala:1291)
	at scala.List$.loop$0(List.scala:244)
	at scala.List$.mapConserve(List.scala:261)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:1291)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1847)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:2228)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:2260)
	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$1.apply(Analyzer.scala:38)
	at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:220)
	at scala.tools.nsc.Global$GlobalPhase$$anonfun$1.apply(Global.scala:209)
	at scala.tools.nsc.Global$GlobalPhase$$anonfun$1.apply(Global.scala:209)
	at scala.Iterator$class.foreach(Iterator.scala:341)
	at scala.collection.mutable.ListBuffer$$anon$0.foreach(ListBuffer.scala:244)
	at scala.tools.nsc.Global$GlobalPhase.run(Global.scala:209)
	at scala.tools.nsc.Global$Run.compileSources(Global.scala:474)
	at scala.tools.nsc.Global$Run.compile(Global.scala:543)
	at scala.tools.nsc.Main$$anonfun$0.apply(Main.scala:37)
	at scala.tools.nsc.Main$$anonfun$0.apply(Main.scala:34)
	at scala.tools.nsc.EvalLoop$class.loop(EvalLoop.scala:17)
	at scala.tools.nsc.Main$.loop(Main.scala:17)
	at scala.tools.nsc.EvalLoop$class.loop(EvalLoop.scala:18)
	at scala.tools.nsc.Main$.loop(Main.scala:17)
	at scala.tools.nsc.EvalLoop$class.loop(EvalLoop.scala:18)
	at scala.tools.nsc.Main$.loop(Main.scala:17)
	at scala.tools.nsc.EvalLoop$class.loop(EvalLoop.scala:18)
	at scala.tools.nsc.Main$.loop(Main.scala:17)
	at scala.tools.nsc.EvalLoop$class.loop(EvalLoop.scala:18)
	at scala.tools.nsc.Main$.loop(Main.scala:17)
	at scala.tools.nsc.EvalLoop$class.loop(EvalLoop.scala:18)
	at scala.tools.nsc.Main$.loop(Main.scala:17)
	at scala.tools.nsc.EvalLoop$class.loop(EvalLoop.scala:18)
	at scala.tools.nsc.Main$.loop(Main.scala:17)
	at scala.tools.nsc.EvalLoop$class.loop(EvalLoop.scala:18)
	at scala.tools.nsc.Main$.loop(Main.scala:17)
	at scala.tools.nsc.EvalLoop$class.loop(EvalLoop.scala:18)
	at scala.tools.nsc.Main$.loop(Main.scala:17)
	at scala.tools.nsc.EvalLoop$class.loop(EvalLoop.scala:18)
	at scala.tools.nsc.Main$.loop(Main.scala:17)
	at scala.tools.nsc.EvalLoop$class.loop(EvalLoop.scala:18)
	at scala.tools.nsc.Main$.loop(Main.scala:17)
	at scala.tools.nsc.EvalLoop$class.loop(EvalLoop.scala:18)
	at scala.tools.nsc.Main$.loop(Main.scala:17)
	at scala.tools.nsc.EvalLoop$class.loop(EvalLoop.scala:18)
	at scala.tools.nsc.Main$.loop(Main.scala:17)
	at scala.tools.nsc.Main$.resident(Main.scala:34)
	at scala.tools.nsc.Main$.process(Main.scala:69)
	at scala.tools.nsc.Main$.main(Main.scala:96)
	at scala.tools.nsc.Main.main(Main.scala)
sean-mcdirmid:~/workspace/test34/src mcdirmid$ 
Same crash. Really cool that the compiler will always crash on run 13, at least that is deterministic!
what expected Shouldn't crash. This bug triggers many crashes in the presentation compiler so it would be VERY nice to be rid of it.
[back to overview]
Changes of this bug report
Sean  edited on  2006-11-25 07:43:49.0
Sean  edited on  2006-11-25 07:44:08.0
Martin  edited on  2006-11-27 13:03:53.0