-
Notifications
You must be signed in to change notification settings - Fork 21
Closed
Milestone
Description
@JamesIry: I assigned the bug to you, but feel free to bounce it back if you don't have time. Thanks
Btw, it's a regression from 2.9 (or a bug specific to the asm backend?)
Here goes, compiled via sbt to try different versions of the compiler:
$ cat src/main/scala/Test.scala
object Test extends App {
@inline final def mbarray_apply_minibox(array: Any, tag: Byte): Long =
if (tag == 0) {
array.asInstanceOf[Array[Long]](0)
} else
array.asInstanceOf[Array[Byte]](0).toLong
def crash_method(): Unit =
mbarray_apply_minibox(null, 0)
}
$ cat build.sbt
scalacOptions in Compile += "-optimize"
resolvers in ThisBuild += ScalaToolsSnapshots
$ sbt -sbt-version 0.12.1
Detected sbt version 0.12.1
Starting sbt: invoke with -help for other options
Picked up _JAVA_OPTIONS: -Xms2g -Xmx2g -Xss4m -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=512M -XX:ReservedCodeCacheSize=256m -XX:+UseParallelGC -XX:PermSize=256m -XX:+TieredCompilation -XX:+UseNUMA
[info] Set current project to default-5d6c1b (in build file:/mnt/data-local/Work/Workspace/dev/backend-bug/)
>
>
>
> clean
[success] Total time: 0 s, completed Feb 3, 2013 10:24:15 PM
> ++ 2.9.3-SNAPSHOT compile
Setting version to 2.9.3-SNAPSHOT
[info] Set current project to default-5d6c1b (in build file:/mnt/data-local/Work/Workspace/dev/backend-bug/)
[info] Updating {file:/mnt/data-local/Work/Workspace/dev/backend-bug/}default-5d6c1b...
[info] Resolving org.scala-lang#scala-library;2.9.3-SNAPSHOT ...
[info] Done updating.
[info] Compiling 1 Scala source to /mnt/data-local/Work/Workspace/dev/backend-bug/target/scala-2.9.3-SNAPSHOT/classes...
[success] Total time: 5 s, completed Feb 3, 2013 10:24:22 PM
>
>
>
>
> clean
[success] Total time: 0 s, completed Feb 3, 2013 10:24:27 PM
> ++ 2.10.1-SNAPSHOT compile
Setting version to 2.10.1-SNAPSHOT
[info] Set current project to default-5d6c1b (in build file:/mnt/data-local/Work/Workspace/dev/backend-bug/)
[info] Updating {file:/mnt/data-local/Work/Workspace/dev/backend-bug/}default-5d6c1b...
[info] Resolving org.scala-lang#scala-library;2.10.1-SNAPSHOT ...
[info] Done updating.
[info] Compiling 1 Scala source to /mnt/data-local/Work/Workspace/dev/backend-bug/target/scala-2.10/classes...
[error]
[error] while compiling: /mnt/data-local/Work/Workspace/dev/backend-bug/src/main/scala/Test.scala
[error] during phase: jvm
[error] library version: version 2.10.1-20130131-134838-d672102fd8
[error] compiler version: version 2.10.1-20130131-134838-d672102fd8
[error] reconstructed args: -classpath /mnt/data-local/Work/Workspace/dev/backend-bug/target/scala-2.10/classes -Ydead-code -optimise -d /mnt/data-local/Work/Workspace/dev/backend-bug/target/scala-2.10/classes -Yinline -Yclosure-elim -Yinline-handlers -bootclasspath /usr/lib/jvm/java-7-oracle/jre/lib/resources.jar:/usr/lib/jvm/java-7-oracle/jre/lib/rt.jar:/usr/lib/jvm/java-7-oracle/jre/lib/sunrsasign.jar:/usr/lib/jvm/java-7-oracle/jre/lib/jsse.jar:/usr/lib/jvm/java-7-oracle/jre/lib/jce.jar:/usr/lib/jvm/java-7-oracle/jre/lib/charsets.jar:/usr/lib/jvm/java-7-oracle/jre/lib/jfr.jar:/usr/lib/jvm/java-7-oracle/jre/classes:/home/sun/.sbt/boot/scala-2.10.1-SNAPSHOT/lib/scala-library.jar
[error]
[error] last tree to typer: TypeTree(trait App)
[error] symbol: trait App in package scala (flags: <interface> abstract <trait> <lateinterface>)
[error] symbol definition: abstract trait App extends DelayedInit
[error] tpe: App
[error] symbol owners: trait App -> package scala
[error] context owners: object Test -> package <empty>
[error]
[error] == Enclosing template or block ==
[error]
looong useless output
[error]
[error] == Expanded type of tree ==
[error]
[error] TypeRef(TypeSymbol(abstract trait App extends DelayedInit))
[error]
[error] uncaught exception during compilation: java.lang.ArrayIndexOutOfBoundsException
[trace] Stack trace suppressed: run last compile:compile for the full output.
[error] (compile:compile) java.lang.ArrayIndexOutOfBoundsException: 0
[error] Total time: 4 s, completed Feb 3, 2013 10:24:35 PM
> last compile:compile
[debug]
[debug] Initial source changes:
[debug] removed:Set()
[debug] added: Set(/mnt/data-local/Work/Workspace/dev/backend-bug/src/main/scala/Test.scala)
[debug] modified: Set()
[debug] Removed products: Set()
[debug] Modified external sources: Set()
[debug] Modified binary dependencies: Set()
[debug] Initial directly invalidated sources: Set(/mnt/data-local/Work/Workspace/dev/backend-bug/src/main/scala/Test.scala)
[debug]
[debug] Sources indirectly invalidated by:
[debug] product: Set()
[debug] binary dep: Set()
[debug] external source: Set()
[debug] Initially invalidated: Set(/mnt/data-local/Work/Workspace/dev/backend-bug/src/main/scala/Test.scala)
[info] Compiling 1 Scala source to /mnt/data-local/Work/Workspace/dev/backend-bug/target/scala-2.10/classes...
[debug] Running cached compiler 27e675fc, interfacing (CompilerInterface) with Scala compiler version 2.10.1-20130131-134838-d672102fd8
[debug] Calling Scala compiler with arguments (CompilerInterface):
[debug] -optimize
[debug] -d
[debug] /mnt/data-local/Work/Workspace/dev/backend-bug/target/scala-2.10/classes
[debug] -bootclasspath
[debug] /usr/lib/jvm/java-7-oracle/jre/lib/resources.jar:/usr/lib/jvm/java-7-oracle/jre/lib/rt.jar:/usr/lib/jvm/java-7-oracle/jre/lib/sunrsasign.jar:/usr/lib/jvm/java-7-oracle/jre/lib/jsse.jar:/usr/lib/jvm/java-7-oracle/jre/lib/jce.jar:/usr/lib/jvm/java-7-oracle/jre/lib/charsets.jar:/usr/lib/jvm/java-7-oracle/jre/lib/jfr.jar:/usr/lib/jvm/java-7-oracle/jre/classes:/home/sun/.sbt/boot/scala-2.10.1-SNAPSHOT/lib/scala-library.jar
[debug] -classpath
[debug] /mnt/data-local/Work/Workspace/dev/backend-bug/target/scala-2.10/classes
[error]
[error] while compiling: /mnt/data-local/Work/Workspace/dev/backend-bug/src/main/scala/Test.scala
[error] during phase: jvm
[error] library version: version 2.10.1-20130131-134838-d672102fd8
[error] compiler version: version 2.10.1-20130131-134838-d672102fd8
[error] reconstructed args: -classpath /mnt/data-local/Work/Workspace/dev/backend-bug/target/scala-2.10/classes -Ydead-code -optimise -d /mnt/data-local/Work/Workspace/dev/backend-bug/target/scala-2.10/classes -Yinline -Yclosure-elim -Yinline-handlers -bootclasspath /usr/lib/jvm/java-7-oracle/jre/lib/resources.jar:/usr/lib/jvm/java-7-oracle/jre/lib/rt.jar:/usr/lib/jvm/java-7-oracle/jre/lib/sunrsasign.jar:/usr/lib/jvm/java-7-oracle/jre/lib/jsse.jar:/usr/lib/jvm/java-7-oracle/jre/lib/jce.jar:/usr/lib/jvm/java-7-oracle/jre/lib/charsets.jar:/usr/lib/jvm/java-7-oracle/jre/lib/jfr.jar:/usr/lib/jvm/java-7-oracle/jre/classes:/home/sun/.sbt/boot/scala-2.10.1-SNAPSHOT/lib/scala-library.jar
[error]
[error] last tree to typer: TypeTree(trait App)
[error] symbol: trait App in package scala (flags: <interface> abstract <trait> <lateinterface>)
[error] symbol definition: abstract trait App extends DelayedInit
[error] tpe: App
[error] symbol owners: trait App -> package scala
[error] context owners: object Test -> package <empty>
[error]
[error] == Enclosing template or block ==
[error]
looong useless output
[error]
[error] == Expanded type of tree ==
[error]
[error] TypeRef(TypeSymbol(abstract trait App extends DelayedInit))
[error]
[error] uncaught exception during compilation: java.lang.ArrayIndexOutOfBoundsException
java.lang.ArrayIndexOutOfBoundsException: 0
at scala.tools.asm.Frame.merge(Unknown Source)
at scala.tools.asm.Frame.merge(Unknown Source)
at scala.tools.asm.MethodWriter.visitMaxs(Unknown Source)
at scala.tools.nsc.backend.jvm.GenASM$JPlainBuilder.genMethod(GenASM.scala:1565)
at scala.tools.nsc.backend.jvm.GenASM$JPlainBuilder.genClass(GenASM.scala:1398)
at scala.tools.nsc.backend.jvm.GenASM$AsmPhase.run(GenASM.scala:119)
at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1582)
at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1556)
at scala.tools.nsc.Global$Run.compileSources(Global.scala:1552)
at scala.tools.nsc.Global$Run.compile(Global.scala:1661)
at xsbt.CachedCompiler0.run(CompilerInterface.scala:90)
at xsbt.CachedCompiler0.run(CompilerInterface.scala:72)
at xsbt.CompilerInterface.run(CompilerInterface.scala:26)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at sbt.compiler.AnalyzingCompiler.call(AnalyzingCompiler.scala:73)
at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:35)
at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:29)
at sbt.compiler.AggressiveCompile$$anonfun$4$$anonfun$compileScala$1$1.apply$mcV$sp(AggressiveCompile.scala:71)
at sbt.compiler.AggressiveCompile$$anonfun$4$$anonfun$compileScala$1$1.apply(AggressiveCompile.scala:71)
at sbt.compiler.AggressiveCompile$$anonfun$4$$anonfun$compileScala$1$1.apply(AggressiveCompile.scala:71)
at sbt.compiler.AggressiveCompile.sbt$compiler$AggressiveCompile$$timed(AggressiveCompile.scala:101)
at sbt.compiler.AggressiveCompile$$anonfun$4.compileScala$1(AggressiveCompile.scala:70)
at sbt.compiler.AggressiveCompile$$anonfun$4.apply(AggressiveCompile.scala:88)
at sbt.compiler.AggressiveCompile$$anonfun$4.apply(AggressiveCompile.scala:60)
at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:24)
at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:22)
at sbt.inc.Incremental$.cycle(Incremental.scala:40)
at sbt.inc.Incremental$.compile(Incremental.scala:25)
at sbt.inc.IncrementalCompile$.apply(Compile.scala:20)
at sbt.compiler.AggressiveCompile.compile2(AggressiveCompile.scala:96)
at sbt.compiler.AggressiveCompile.compile1(AggressiveCompile.scala:44)
at sbt.compiler.AggressiveCompile.apply(AggressiveCompile.scala:31)
at sbt.Compiler$.apply(Compiler.scala:79)
at sbt.Defaults$$anonfun$compileTask$1.apply(Defaults.scala:572)
at sbt.Defaults$$anonfun$compileTask$1.apply(Defaults.scala:572)
at sbt.Scoped$$anonfun$hf2$1.apply(Structure.scala:578)
at sbt.Scoped$$anonfun$hf2$1.apply(Structure.scala:578)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:49)
at sbt.Scoped$Reduced$$anonfun$combine$1$$anonfun$apply$12.apply(Structure.scala:311)
at sbt.Scoped$Reduced$$anonfun$combine$1$$anonfun$apply$12.apply(Structure.scala:311)
at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:41)
at sbt.std.Transform$$anon$5.work(System.scala:71)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:232)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:232)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
at sbt.Execute.work(Execute.scala:238)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:232)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:232)
at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:30)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
[error] (compile:compile) java.lang.ArrayIndexOutOfBoundsException: 0
>