question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dotty Repl OOM's on one-liner input

See original GitHub issue

Minimized 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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
oderskycommented, Jan 4, 2021

@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.

0reactions
emilypicommented, Jan 10, 2021

Thanks for looking into that @odersky

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found