gpt4 book ai didi

scala - sbt 编译导致 stackoverflow 错误

转载 作者:行者123 更新时间:2023-12-04 01:11:18 28 4
gpt4 key购买 nike

我已经面临这个错误一段时间了。因为这个,完全被激怒了。尝试了在 stackoverflow 和其他站点中看到的所有类似解决方案。

我有 4 个独立的 Scala 项目。其中,我在编译两个项目时遇到 StackOverflow 错误。这两个项目是4个项目中最大的项目。
当我尝试在 Ubuntu Server 机器上构建项目时出现此错误。我尝试在 sbt 配置文件中增加 Xmx 选项,但没有成功。

任何人都可以帮我解决这个问题,因为我快疯了。如果我构建该项目 10 次,它将在 1 或 2 次尝试中成功。

我从错误日志中了解到问题来自类型检查。但是,我不知道发生在哪里。

其中一个失败的项目有超过 1000 个类/特征(不包括案例类)。

详情 :

Ubuntu Server(14)
Sbt : 0.13.6 and 0.13.8 tried
Scala Version : 2.11.6
JDK: 1.8

下面粘贴了几行错误:
java.lang.StackOverflowError
at scala.tools.nsc.transform.Erasure$Eraser.typed1(Erasure.scala:696)
at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5396)
at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5423)
at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5370)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5374)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$96.apply(Typers.scala:4523)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$96.apply(Typers.scala:4523)
at scala.tools.nsc.typechecker.Typers$Typer.silent(Typers.scala:680)
at scala.tools.nsc.typechecker.Typers$Typer.normalTypedApply$1(Typers.scala:4522)
at scala.tools.nsc.typechecker.Typers$Typer.typedApply$1(Typers.scala:4578)
at scala.tools.nsc.typechecker.Typers$Typer.typedInAnyMode$1(Typers.scala:5343)
at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5360)
at scala.tools.nsc.transform.Erasure$Eraser.typed1(Erasure.scala:696)
at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5396)
at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5423)
at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5370)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5374)
at scala.tools.nsc.typechecker.Typers$Typer.typedQualifier(Typers.scala:5472)
at scala.tools.nsc.typechecker.Typers$Typer.typedQualifier(Typers.scala:5480)
at scala.tools.nsc.transform.Erasure$Eraser.adaptMember(Erasure.scala:642)
at scala.tools.nsc.transform.Erasure$Eraser.typed1(Erasure.scala:696)
at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5396)
at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5423)
at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5370)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5374)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$96.apply(Typers.scala:4523)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$96.apply(Typers.scala:4523)
at scala.tools.nsc.typechecker.Typers$Typer.silent(Typers.scala:680)
at scala.tools.nsc.typechecker.Typers$Typer.normalTypedApply$1(Typers.scala:4522)
at scala.tools.nsc.typechecker.Typers$Typer.typedApply$1(Typers.scala:4578)
at scala.tools.nsc.typechecker.Typers$Typer.typedInAnyMode$1(Typers.scala:5343)
at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5360)
at scala.tools.nsc.transform.Erasure$Eraser.typed1(Erasure.scala:696)
at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5396)
at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5423)
at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5370)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5374)
at scala.tools.nsc.typechecker.Typers$Typer.typedArg(Typers.scala:3163)
at scala.tools.nsc.typechecker.PatternTypers$PatternTyper$class.typedArgWithFormal$1(PatternTypers.scala:112)
at scala.tools.nsc.typechecker.PatternTypers$PatternTyper$$anonfun$2.apply(PatternTypers.scala:115)
at scala.tools.nsc.typechecker.PatternTypers$PatternTyper$$anonfun$2.apply(PatternTypers.scala:115)
at scala.runtime.Tuple2Zipped$$anonfun$map$extension$1.apply(Tuple2Zipped.scala:46)
at scala.runtime.Tuple2Zipped$$anonfun$map$extension$1.apply(Tuple2Zipped.scala:44)
at scala.collection.immutable.List.foreach(List.scala:381)
at scala.runtime.Tuple2Zipped$.map$extension(Tuple2Zipped.scala:44)
at scala.tools.nsc.typechecker.PatternTypers$PatternTyper$class.typedArgsForFormals(PatternTypers.scala:115)
at scala.tools.nsc.typechecker.Typers$Typer.typedArgsForFormals(Typers.scala:111)
at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$handleMonomorphicCall$1(Typers.scala:3469)
at scala.tools.nsc.typechecker.Typers$Typer.doTypedApply(Typers.scala:3494)
at scala.tools.nsc.typechecker.Typers$Typer.normalTypedApply$1(Typers.scala:4544)
at scala.tools.nsc.typechecker.Typers$Typer.typedApply$1(Typers.scala:4578)
at scala.tools.nsc.typechecker.Typers$Typer.typedInAnyMode$1(Typers.scala:5343)
at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5360)
at scala.tools.nsc.transform.Erasure$Eraser.typed1(E

最佳答案

从 2.11.4 到 2.11.6 afaik,这一直影响 Scala。它在 2.11.7 的最新发行说明中似乎没有修复。

幸好关注了track在问题跟踪器上,它是重复的 ticketstack overflow 上有答案

没有源代码更难给出更多指示,但这绝对应该是一个很好的指针来找到问题并应用建议的解决方案

关于scala - sbt 编译导致 stackoverflow 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31049589/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com