Scala Programming Language
  1. Scala Programming Language
  2. SI-6299

REPL Crashes on startup if you type too fast.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Duplicate
    • Affects Version/s: Scala 2.10.0
    • Fix Version/s: None
    • Component/s: Repl / Interpreter
    • Labels:
      None

      Description

      Welcome to Scala version 2.10.0-M7 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_33).
      Type in expressions to have them evaluated.
      Type :help for more information.
      
      scala> Either
      
      Failed to initialize the REPL due to an unexpected error.
      This is a bug, please, report it along with the error diagnostics printed below.
      java.lang.NullPointerException
      	at scala.reflect.internal.SymbolTable.afterPhase(SymbolTable.scala:208)
      	at scala.tools.nsc.Global.afterFlatten(Global.scala:1092)
      	at scala.tools.nsc.transform.Flatten$$anon$1$$anonfun$1.apply(Flatten.scala:70)
      	at scala.tools.nsc.transform.Flatten$$anon$1$$anonfun$1.apply(Flatten.scala:67)
      	at scala.reflect.internal.Scopes$class.scopeTransform(Scopes.scala:383)
      	at scala.reflect.internal.SymbolTable.scopeTransform(SymbolTable.scala:12)
      	at scala.tools.nsc.transform.Flatten$$anon$1.apply(Flatten.scala:67)
      	at scala.tools.nsc.transform.Flatten.transformInfo(Flatten.scala:100)
      	at scala.tools.nsc.transform.InfoTransform$Phase$$anon$1.transform(InfoTransform.scala:38)
      	at scala.reflect.internal.Symbols$Symbol.rawInfo(Symbols.scala:1247)
      	at scala.reflect.internal.Symbols$Symbol.info(Symbols.scala:1175)
      	at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:39)
      	at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:36)
      	at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:36)
      	at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:57)
      	at scala.reflect.internal.Mirrors$RootsBase.getClassByName(Mirrors.scala:95)
      	at scala.reflect.internal.Mirrors$RootsBase.getRequiredClass(Mirrors.scala:98)
      	at scala.tools.nsc.backend.jvm.GenASM$AsmPhase.<init>(GenASM.scala:56)
      	at scala.tools.nsc.backend.jvm.GenASM.newPhase(GenASM.scala:33)
      	at scala.tools.nsc.Global$Run$$anonfun$27.apply(Global.scala:1294)
      	at scala.tools.nsc.Global$Run$$anonfun$27.apply(Global.scala:1294)
      	at scala.collection.LinearSeqOptimized$class.foldLeft(LinearSeqOptimized.scala:110)
      	at scala.collection.immutable.List.foldLeft(List.scala:78)
      	at scala.tools.nsc.Global$Run.<init>(Global.scala:1294)
      	at scala.tools.nsc.interpreter.IMain.compileSourcesKeepingRun(IMain.scala:424)
      	at scala.tools.nsc.interpreter.IMain$ReadEvalPrint.compileAndSaveRun(IMain.scala:799)
      	at scala.tools.nsc.interpreter.IMain$ReadEvalPrint.compile(IMain.scala:759)
      	at scala.tools.nsc.interpreter.IMain.bind(IMain.scala:616)
      	at scala.tools.nsc.interpreter.IMain.bind(IMain.scala:659)
      	at scala.tools.nsc.interpreter.IMain$$anonfun$quietBind$1.apply(IMain.scala:658)
      	at scala.tools.nsc.interpreter.IMain$$anonfun$quietBind$1.apply(IMain.scala:658)
      	at scala.tools.nsc.interpreter.IMain.beQuietDuring(IMain.scala:232)
      	at scala.tools.nsc.interpreter.IMain.quietBind(IMain.scala:658)
      	at scala.tools.nsc.interpreter.ILoop$$anonfun$process$1$$anonfun$apply$mcZ$sp$2.apply$mcV$sp(ILoop.scala:838)
      	at scala.tools.nsc.interpreter.ILoopInit$class.runThunks(ILoopInit.scala:122)
      	at scala.tools.nsc.interpreter.ILoop.runThunks(ILoop.scala:42)
      	at scala.tools.nsc.interpreter.ILoopInit$class.postInitialization(ILoopInit.scala:95)
      	at scala.tools.nsc.interpreter.ILoop.postInitialization(ILoop.scala:42)
      	at scala.tools.nsc.interpreter.ILoopInit$$anonfun$createAsyncListener$1.apply$mcV$sp(ILoopInit.scala:63)
      	at scala.tools.nsc.interpreter.ILoopInit$$anonfun$createAsyncListener$1.apply(ILoopInit.scala:60)
      	at scala.tools.nsc.interpreter.ILoopInit$$anonfun$createAsyncListener$1.apply(ILoopInit.scala:60)
      	at scala.tools.nsc.io.package$$anon$3.call(package.scala:23)
      	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      	at java.lang.Thread.run(Thread.java:680)
      

        Issue Links

          Activity

          Hide
          Juha Heljoranta added a comment -

          One reasonably easy way to reproduce this is to type: something<tab><tab><enter>
          If I wait few seconds before typing it doesn't happen.
          Also, it cannot be reproduced if some (simple) expression is evaluated first, like integer 1.

          I've seen few times the stack trace mentioned in this bug and those mentioned in SI-6510.
          In addition there where plenty of new assertion errors and exceptions thrown.

          Some of the new errors I saw:

          unrecoverable error
                  at scala.reflect.internal.SymbolTable.abort(SymbolTable.scala:48)
                  at scala.tools.nsc.Global.abort(Global.scala:253)
                  at scala.tools.nsc.interpreter.IMain$$anon$1.scala$tools$nsc$interpreter$ReplGlobal$$super$abort(IMain.scala:265)
          
          posterasure
                  at scala.Predef$.assert(Predef.scala:179)
                  at scala.tools.nsc.Global.assert(Global.scala:238)
                  at scala.tools.nsc.transform.Erasure$ErasureTransformer.bridgeDefs(Erasure.scala:971)
          
          This is a bug, please, report it along with the error diagnostics printed below.
          java.lang.AssertionError: assertion failed: TypeHistory(namer:2,()List[Imports.this.global.TypeName],TypeHistory(patmat:2,=> List[Imports.this.global.TypeName],null))
                  at scala.Predef$.assert(Predef.scala:179)
                  at scala.reflect.internal.Symbols$TypeHistory.<init>(Symbols.scala:3280)
          
          This is a bug, please, report it along with the error diagnostics printed below.
          java.lang.AssertionError: assertion failed: TypeHistory(namer:2,Object
                  with scala.tools.nsc.interpreter.Imports {
            private[this] val initialSettings: scala.tools.nsc.Settings
          ... 
            def typeOfExpression$default$2: Boolean @scala.annotation.unchecked.uncheckedVariance
          },null))
                  at scala.Predef$.assert(Predef.scala:179)
                  at scala.reflect.internal.Symbols$TypeHistory.<init>(Symbols.scala:3280)
                  at scala.reflect.internal.Symbols$Symbol.rawInfo(Symbols.scala:1301)
          

          I was testing with 2.10.0-RC1.

          Show
          Juha Heljoranta added a comment - One reasonably easy way to reproduce this is to type: something<tab><tab><enter> If I wait few seconds before typing it doesn't happen. Also, it cannot be reproduced if some (simple) expression is evaluated first, like integer 1. I've seen few times the stack trace mentioned in this bug and those mentioned in SI-6510 . In addition there where plenty of new assertion errors and exceptions thrown. Some of the new errors I saw: unrecoverable error at scala.reflect.internal.SymbolTable.abort(SymbolTable.scala:48) at scala.tools.nsc.Global.abort(Global.scala:253) at scala.tools.nsc.interpreter.IMain$$anon$1.scala$tools$nsc$interpreter$ReplGlobal$$super$abort(IMain.scala:265) posterasure at scala.Predef$.assert(Predef.scala:179) at scala.tools.nsc.Global.assert(Global.scala:238) at scala.tools.nsc.transform.Erasure$ErasureTransformer.bridgeDefs(Erasure.scala:971) This is a bug, please, report it along with the error diagnostics printed below. java.lang.AssertionError: assertion failed: TypeHistory(namer:2,()List[Imports.this.global.TypeName],TypeHistory(patmat:2,=> List[Imports.this.global.TypeName],null)) at scala.Predef$.assert(Predef.scala:179) at scala.reflect.internal.Symbols$TypeHistory.<init>(Symbols.scala:3280) This is a bug, please, report it along with the error diagnostics printed below. java.lang.AssertionError: assertion failed: TypeHistory(namer:2,Object with scala.tools.nsc.interpreter.Imports { private[this] val initialSettings: scala.tools.nsc.Settings ... def typeOfExpression$default$2: Boolean @scala.annotation.unchecked.uncheckedVariance },null)) at scala.Predef$.assert(Predef.scala:179) at scala.reflect.internal.Symbols$TypeHistory.<init>(Symbols.scala:3280) at scala.reflect.internal.Symbols$Symbol.rawInfo(Symbols.scala:1301) I was testing with 2.10.0-RC1.
          Hide
          Jason Zaugg added a comment -

          Closing as a duplicate of SI-7418.

          Show
          Jason Zaugg added a comment - Closing as a duplicate of SI-7418 .

            People

            • Assignee:
              Jason Zaugg
              Reporter:
              Josh Suereth
            • Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development