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.

build-scala generates java.lang.StackOverflowError with Java 1.8

See original GitHub issue

I get java.lang.StackOverflowError trying to build the Scala version of firrtl with Scala 2.11, sbt 0.13.9, and (Oracle) Java 1.8.0_74 on MacOSX 10.9.5, and Scala 2.11, sbt 0.13.9, and (Oracle) Java 1.8.0_45 on Ubuntu 14.04.2 LTS. This still occurs after deleting everything in ~/.ivy2 and ~/.m2

This doesn’t happen with Java 1.7.0_76 (on MacOSX) or 1.7.0_80 (on Ubuntu).

Here’s the bottom of the Ubuntu stack dump:

java.lang.StackOverflowError
    at scala.tools.nsc.typechecker.Typers$Typer.checkDead(Typers.scala:111)
    at scala.tools.nsc.typechecker.Typers$Typer.typedSelectOrSuperCall$1(Typers.scala:4811)
    at scala.tools.nsc.typechecker.Typers$Typer.typedInAnyMode$1(Typers.scala:5343)
    at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5359)
    at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5395)
    at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5422)
    at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5369)
    at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5373)
    at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$99.apply(Typers.scala:4524)
    at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$99.apply(Typers.scala:4524)
    at scala.tools.nsc.typechecker.Typers$Typer.silent(Typers.scala:680)
    at scala.tools.nsc.typechecker.Typers$Typer.normalTypedApply$1(Typers.scala:4523)
    at scala.tools.nsc.typechecker.Typers$Typer.typedApply$1(Typers.scala:4579)
    at scala.tools.nsc.typechecker.Typers$Typer.typedInAnyMode$1(Typers.scala:5342)
    at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5359)
    at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5395)
    at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5422)
    at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5369)
    at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5373)
    at scala.tools.nsc.typechecker.Typers$Typer.typedQualifier(Typers.scala:5471)
    at scala.tools.nsc.typechecker.Typers$Typer.typedQualifier(Typers.scala:5477)
    at scala.tools.nsc.typechecker.Typers$Typer.typedSelectOrSuperCall$1(Typers.scala:4811)
    at scala.tools.nsc.typechecker.Typers$Typer.typedInAnyMode$1(Typers.scala:5343)
    at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5359)
    at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5395)

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

19reactions
ucbjrlcommented, Feb 25, 2016

-Xss256m does the trick.

7reactions
kammohcommented, Feb 25, 2016

Hi,

Have you tried increasing the JVM stack size (-Xss)? I know this shouldn’t be really necessary but -Xss256m -Xmx4096m solved the issue for me. (bumped to sbt 0.13.9, scala 2.11.7, running on Oracle JVM 1.8.0_74-b02)

Kamyar

On Tue, Feb 23, 2016 at 10:25 PM, Adam Izraelevitz <notifications@github.com

wrote:

I saw this error as well - it looks like its a bug in the scala compiler (or how sbt decides what to compile). Have you tried deleting everything and starting with a fresh repo? The only (REALLY HACKY) thing that worked for me was to slowly comment out portions of the code until it correctly compiled. Then, when I uncommented the code back, it worked.

I tried deleting .ivy2 and .sbt caches, as well as sbt clean (and all things suggested here http://stackoverflow.com/questions/4483230/an-easy-way-to-get-rid-of-everything-generated-by-sbt), to no avail.

— Reply to this email directly or view it on GitHub https://github.com/ucb-bar/firrtl/issues/66#issuecomment-187840725.

Read more comments on GitHub >

github_iconTop Results From Across the Web

build-scala generates java.lang.StackOverflowError with ...
I get java.lang.StackOverflowError trying to build the Scala version of firrtl with Scala 2.11, sbt 0.13.9, and (Oracle) Java 1.8.0_74 on ...
Read more >
How to Fix java.lang.StackOverflowError in Java
The java. lang. StackOverflowError indicates that the application stack is exhausted and is usually caused by deep or infinite recursion.
Read more >
What causes a java.lang.StackOverflowError
Check for any recusive calls for methods. Mainly it is caused when there is recursive call for a method. A simple example is...
Read more >
Scala source code can't compile because of java.lang. ...
error when I try to build it with ant: ... [scalacfork] uncaught exception during compilation: java.lang.StackOverflowError [scalacfork] error: java.lang.
Read more >
Diagnosing a java.lang.StackOverflowError
Symptom. A stack overflow can result from: A deeply nested application; An infinite loop within an application; A problem in just-in-time ...
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