Skip to content
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

Compiler 2.8.0 hangs with -optimise option #2171

Closed
scabug opened this issue Jul 20, 2009 · 10 comments
Closed

Compiler 2.8.0 hangs with -optimise option #2171

scabug opened this issue Jul 20, 2009 · 10 comments
Assignees

Comments

@scabug
Copy link

scabug commented Jul 20, 2009

"scalac -optimise" is unable to finish compilation of the following code:

final object test {
    @inline
    def logIgnoredException (message : => String) (code : => Unit) =
    {
        try {
            code
        } catch {
            case ex: Exception =>
                println (message)
        }
    }

    def main (args: Array[String]) = {	
    	while (true) {
	      logIgnoredException ("...") {
	          ()
	      }
	}
    }
}
@scabug
Copy link
Author

scabug commented Jul 20, 2009

Imported From: https://issues.scala-lang.org/browse/SI-2171?orig=1
Reporter: Evgeny (akshaal)

@scabug
Copy link
Author

scabug commented Jun 15, 2010

@paulp said:
This is looping in type flow analysis. I'd like to say it's a duplicate of #3476 but the only way I'm sure they're related is that neither will ever halt, and that's not the foundation of a good duplicate relationship.

@scabug
Copy link
Author

scabug commented Jun 18, 2010

@paulp said:
Distilled.

final object test {
  def logIgnoredException(msg: => String) =
    try 0 catch { case ex => println(msg) }

    def main (args: Array[String]): Unit =
      while (true) logIgnoredException ("...") 
}

@scabug
Copy link
Author

scabug commented Jun 21, 2010

@paulp said:
Hard to look like a genius when commenting back in commented out code, but this can be fixed with the following:

-            in(p) = lattice.lub(/*in(p) :: */(p.predecessors map out.apply), p.exceptionHandlerStart)
+            in(p) = lattice.lub(in(p) :: (p.predecessors map out), p.exceptionHandlerStart)

@scabug
Copy link
Author

scabug commented Jun 22, 2010

@dragos said:
The issues are deeper, and I am not sure how to fix it just now. I will have a look at these bugs in a week's time. (most probably that comment is in place to fix some other non-terminating scenario).

@scabug
Copy link
Author

scabug commented Oct 6, 2010

@paulp said:
(In r23207) An obviously wrong yet somehow brilliant piece of code
uncommenting. References #2171 without fixing it. Removes
the non-termination which had caused me to revert r23174, which
itself immediately follows this patch. No review (but iulian
says he will look at this situation somewhere down the line.)

@scabug
Copy link
Author

scabug commented Oct 24, 2010

@paulp said:
See #3956 for another example.

@scabug
Copy link
Author

scabug commented Feb 13, 2011

@soc said:
Crashes the REPL on Scala 2.9.0.r24145-b20110130020134:

Exception in thread "main" java.lang.AssertionError: assertion failed
	at scala.Predef$$.assert(Predef.scala:85)
	at scala.tools.nsc.transform.Mixin.mixinImplClassMembers$$1(Mixin.scala:253)
	at scala.tools.nsc.transform.Mixin$$$$anonfun$$addMixedinMembers$$3.apply(Mixin.scala:343)
	at scala.tools.nsc.transform.Mixin$$$$anonfun$$addMixedinMembers$$3.apply(Mixin.scala:337)
	at scala.collection.LinearSeqOptimized$$class.foreach(LinearSeqOptimized.scala:61)
	at scala.collection.immutable.List.foreach(List.scala:45)
	at scala.tools.nsc.transform.Mixin.addMixedinMembers(Mixin.scala:337)
	at scala.tools.nsc.transform.Mixin.addMixedinMembers(Mixin.scala:247)
	at scala.tools.nsc.transform.Mixin$$MixinTransformer.preTransform(Mixin.scala:495)
	at scala.tools.nsc.transform.Mixin$$MixinTransformer.transform(Mixin.scala:1212)
	at scala.tools.nsc.ast.Trees$$Transformer.transformTemplate(Trees.scala:860)
	at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$transform$$2.apply(Trees.scala:752)
	at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$transform$$2.apply(Trees.scala:751)
	at scala.tools.nsc.ast.Trees$$Transformer.atOwner(Trees.scala:884)
	at scala.tools.nsc.ast.Trees$$Transformer.transform(Trees.scala:750)
	at scala.tools.nsc.transform.Mixin$$MixinTransformer.transform(Mixin.scala:1212)
	at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$transformStats$$1.apply(Trees.scala:876)
	at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$transformStats$$1.apply(Trees.scala:874)
	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:874)
	at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$transform$$1.apply(Trees.scala:746)
	at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$transform$$1.apply(Trees.scala:746)
	at scala.tools.nsc.ast.Trees$$Transformer.atOwner(Trees.scala:884)
	at scala.tools.nsc.ast.Trees$$Transformer.transform(Trees.scala:745)
	at scala.tools.nsc.transform.Mixin$$MixinTransformer.transform(Mixin.scala:1212)
	at scala.tools.nsc.ast.Trees$$Transformer.transformUnit(Trees.scala:877)
	at scala.tools.nsc.transform.Transform$$Phase.apply(Transform.scala:30)
	at scala.tools.nsc.Global$$GlobalPhase$$$$anonfun$$applyPhase$$1.apply(Global.scala:340)
	at scala.tools.nsc.Global$$GlobalPhase$$$$anonfun$$applyPhase$$1.apply(Global.scala:340)
	at scala.tools.nsc.reporters.Reporter.withSource(Reporter.scala:48)
	at scala.tools.nsc.Global$$GlobalPhase.applyPhase(Global.scala:340)
	at scala.tools.nsc.Global$$GlobalPhase$$$$anonfun$$run$$1.apply(Global.scala:309)
	at scala.tools.nsc.Global$$GlobalPhase$$$$anonfun$$run$$1.apply(Global.scala:309)
	at scala.collection.Iterator$$class.foreach(Iterator.scala:646)
	at scala.collection.mutable.ListBuffer$$$$anon$$1.foreach(ListBuffer.scala:311)
	at scala.tools.nsc.Global$$GlobalPhase.run(Global.scala:309)
	at scala.tools.nsc.Global$$Run.compileSources(Global.scala:874)
	at scala.tools.nsc.interpreter.IMain.compileAndSaveRun(IMain.scala:559)
	at scala.tools.nsc.interpreter.IMain$$Request.objRun(IMain.scala:938)
	at scala.tools.nsc.interpreter.IMain$$Request.compile(IMain.scala:961)
	at scala.tools.nsc.interpreter.IMain.interpret(IMain.scala:643)
	at scala.tools.nsc.interpreter.IMain.interpret(IMain.scala:621)
	at scala.tools.nsc.interpreter.ILoop.reallyInterpret$$1(ILoop.scala:504)
	at scala.tools.nsc.interpreter.ILoop.interpretStartingWith(ILoop.scala:544)
	at scala.tools.nsc.interpreter.ILoop.command(ILoop.scala:394)
	at scala.tools.nsc.interpreter.ILoop.processLine$$1(ILoop.scala:294)
	at scala.tools.nsc.interpreter.ILoop.loop(ILoop.scala:300)
	at scala.tools.nsc.interpreter.ILoop.process(ILoop.scala:609)
	at scala.tools.nsc.interpreter.ILoop.main(ILoop.scala:661)
	at scala.tools.nsc.MainGenericRunner$$.process(MainGenericRunner.scala:76)
	at scala.tools.nsc.MainGenericRunner$$.main(MainGenericRunner.scala:32)
	at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)

@scabug
Copy link
Author

scabug commented Mar 14, 2011

@soc said:
Doesn't crash the REPL anymore with 2.9.0.r24394-b20110307020059.

Was this fixed by chance?

@scabug
Copy link
Author

scabug commented Jun 25, 2011

Commit Message Bot (anonymous) said:
(extempore in r25156) Test cases close #2782, #2171, no review.

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

No branches or pull requests

2 participants