Dotty Repl OOM's on one-liner input
See original GitHub issueMinimized code
scala> val I1: Int = 0 * * * 8 * 1 - 1 + 1 +
Output
Exception in thread "main" java.lang.OutOfMemoryError: GC overhead limit exceeded
at scala.runtime.IntRef.create(IntRef.java:22)
at dotty.tools.dotc.ast.Trees$Tree.treeSize(Trees.scala:182)
at dotty.tools.dotc.ast.Trees$Tree.addSize$2(Trees.scala:184)
at dotty.tools.dotc.ast.Trees$Tree.treeSize$$anonfun$1(Trees.scala:188)
at dotty.tools.dotc.ast.Trees$Tree$$Lambda$786/1712635211.applyVoid(Unknown Source)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
at scala.collection.IterableOnceOps.foreach(IterableOnce.scala:563)
at scala.collection.IterableOnceOps.foreach$(IterableOnce.scala:561)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1279)
at dotty.tools.dotc.ast.Trees$Tree.treeSize(Trees.scala:188)
at dotty.tools.dotc.ast.Trees$Tree.addSize$2(Trees.scala:184)
at dotty.tools.dotc.ast.Trees$Tree.addSize$1$$anonfun$1(Trees.scala:185)
at dotty.tools.dotc.ast.Trees$Tree$$Lambda$853/2081703861.applyVoid(Unknown Source)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
at scala.collection.immutable.List.foreach(List.scala:333)
at dotty.tools.dotc.ast.Trees$Tree.addSize$2(Trees.scala:185)
at dotty.tools.dotc.ast.Trees$Tree.treeSize$$anonfun$1(Trees.scala:188)
at dotty.tools.dotc.ast.Trees$Tree$$Lambda$786/1712635211.applyVoid(Unknown Source)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
at scala.collection.IterableOnceOps.foreach(IterableOnce.scala:563)
at scala.collection.IterableOnceOps.foreach$(IterableOnce.scala:561)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1279)
at dotty.tools.dotc.ast.Trees$Tree.treeSize(Trees.scala:188)
at dotty.tools.dotc.ast.Trees$Tree.addSize$2(Trees.scala:184)
at dotty.tools.dotc.ast.Trees$Tree.addSize$1$$anonfun$1(Trees.scala:185)
at dotty.tools.dotc.ast.Trees$Tree$$Lambda$853/2081703861.applyVoid(Unknown Source)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
at scala.collection.immutable.List.foreach(List.scala:333)
Expectation
REPL does not OOM.
For more information, see: https://github.com/lampepfl/dotty/issues/9344.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Compiler "hangs" for 1+ minutes on a one line input. · Issue #9344 ...
Found an example that takes "forever" (1-2 minutes) to compile (with an error!) Minimized code // TD-184aaea3a529ccf09be73fa770e0aba21f73983c val I1: Int ...
Read more >Keyboard Control - mpv.io
This plays video from the first v4l input with nearly the lowest latency possible. It's a good replacement for the removed tv:// input....
Read more >Rulemaking Process | US Department of Transportation
How do I submit comments to DOT on proposed rules? We prefer that comments be submitted electronically. It is easier for us to...
Read more >Alpha Big Dot LED Sign
The Alpha Big Dot LED Signs text and graphics in eight colors and three rainbow color combinations. ... One Line – The Alpha...
Read more >How to echo user input in Scala REPL? - Stack Overflow
We are starting with the REPL. The REPL has a bug in that, when the student enters a readLine command, their input is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@emilypi It’s fine. I had another look. The root cause is that errors get propagated too far. They should truncate implicit searches but don’t do it sufficiently well. The compiler is very lenient in that it does not report a type mismatch error if some participant is already erroneous. That’s good to cut down on noise. But it also means that implicit searches can get out of hand, because too much is eligible.
Thanks for looking into that @odersky