Stack overflow during compilation

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Stack overflow during compilation

Rahul Pilani-3
Stack overflow during compilation This is a shot in the dark, but I was wondering if anyone has seen something similar to the stacktrace below? We are getting a Stackoverflow exception when trying to compile some scala files on our build server. It works elsewhere, so I am at a loss as to what might be causing this there. We have tried using different JDKs and diferent
scala versions but with the same result.

I’ve attached the complete stacktrace if anyone is interested.

Vital Stats about our build env:
Linux i386 3G RAM
Java 1.6.0.13
Scala 2.7.7
Maven 2.0.9  

[INFO] Compiling 16 source files to /home/build/.hudson/jobs/NaviTrunk/workspace/trunk/NaviHVUploader/target/classes at 1270690242026
[INFO] java.lang.reflect.InvocationTargetException
[INFO]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[INFO]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[INFO]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[INFO]     at java.lang.reflect.Method.invoke(Method.java:597)
[INFO]     at org_scala_tools_maven_executions.MainHelper.runMain(MainHelper.java:151)
[INFO]     at org_scala_tools_maven_executions.MainWithArgsInFile.main(MainWithArgsInFile.java:26)
[ERROR] Caused by: java.lang.StackOverflowError
[INFO]     at scala.List.map(List.scala:809)
[INFO]     at scala.tools.nsc.transform.Erasure$$anon$1.apply(Erasure.scala:95)
[INFO]     at scala.tools.nsc.transform.Erasure$$anon$1.apply(Erasure.scala:64)
[INFO]     at scala.tools.nsc.transform.Erasure.transformInfo(Erasure.scala:320)
[INFO]     at scala.tools.nsc.transform.InfoTransform$Phase$$anon$1.transform(InfoTransform.scala:32)
[INFO]     at scala.tools.nsc.symtab.Symbols$Symbol.rawInfo(Symbols.scala:625)
[INFO]     at scala.tools.nsc.symtab.Symbols$Symbol.info(Symbols.scala:566)
[INFO]     at scala.tools.nsc.symtab.Symbols$Symbol.tpe(Symbols.scala:534)
[INFO]     at scala.tools.nsc.symtab.Symbols$Symbol.isStable(Symbols.scala:309)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer.typedApply$1(Typers.scala:2639)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:3257)
[INFO]     at scala.tools.nsc.transform.Erasure$Eraser.liftedTree1$1(Erasure.scala:662)
[INFO]     at scala.tools.nsc.transform.Erasure$Eraser.typed1(Erasure.scala:661)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:3358)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer.typedArg(Typers.scala:1649)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$typedArgs$2.apply(Typers.scala:1690)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$typedArgs$2.apply(Typers.scala:1690)
[INFO]     at scala.List$.map2(List.scala:333)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer.typedArgs(Typers.scala:1690)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer.doTypedApply(Typers.scala:1774)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer.typedApply$1(Typers.scala:2657)

... About 500 lines ...

[INFO]     at scala.List$.mapConserve(List.scala:317)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:1643)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:3084)
[INFO]     at scala.tools.nsc.transform.Erasure$Eraser.liftedTree1$1(Erasure.scala:662)
[INFO]     at scala.tools.nsc.transform.Erasure$Eraser.typed1(Erasure.scala:661)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:3358)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:3395)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:1598)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$19.apply(Typers.scala:1643)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$19.apply(Typers.scala:1643)
[INFO]     at scala.List$.loop$1(List.scala:300)
[INFO]     at scala.List$.mapConserve(List.scala:317)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:1643)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:3084)
[INFO]     at scala.tools.nsc.transform.Erasure$Eraser.liftedTree1$1(Erasure.scala:662)
[INFO]     at scala.tools.nsc.transform.Erasure$Eraser.typed1(Erasure.scala:661)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:3358)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:3395)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:1598)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$19.apply(Typers.scala:1643)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$19.apply(Typers.scala:1643)
[INFO]     at scala.List$.loop$1(List.scala:300)
[INFO]     at scala.List$.mapConserve(List.scala:317)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:1643)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:3084)
[INFO]     at scala.tools.nsc.transform.Erasure$Eraser.liftedTree1$1(Erasure.scala:662)
[INFO]     at scala.tools.nsc.transform.Erasure$Eraser.typed1(Erasure.scala:661)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:3358)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:3395)
[INFO]     at scala.tools.nsc.transform.Erasure$ErasureTransformer$$anonfun$transform$1.apply(Erasure.scala:1074)
[INFO]     at scala.tools.nsc.transform.Erasure$ErasureTransformer$$anonfun$transform$1.apply(Erasure.scala:1071)
[INFO]     at scala.tools.nsc.symtab.SymbolTable.atPhase(SymbolTable.scala:106)
[INFO]     at scala.tools.nsc.transform.Erasure$ErasureTransformer.transform(Erasure.scala:1071)
[INFO]     at scala.tools.nsc.ast.Trees$Transformer.transformUnit(Trees.scala:1479)
[INFO]     at scala.tools.nsc.transform.Transform$Phase.apply(Transform.scala:30)
[INFO]     at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:267)
[INFO]     at scala.tools.nsc.Global$GlobalPhase$$anonfun$run$1.apply(Global.scala:246)
[INFO]     at scala.tools.nsc.Global$GlobalPhase$$anonfun$run$1.apply(Global.scala:246)
[INFO]     at scala.Iterator$class.foreach(Iterator.scala:414)
[INFO]     at scala.collection.mutable.ListBuffer$$anon$1.foreach(ListBuffer.scala:266)
[INFO]     at scala.tools.nsc.Global$GlobalPhase.run(Global.scala:246)
[INFO]     at scala.tools.nsc.Global$Run.compileSources(Global.scala:574)
[INFO]     at scala.tools.nsc.Global$Run.compile(Global.scala:667)
[INFO]     at scala.tools.nsc.Main$.process(Main.scala:73)
[INFO]     at scala.tools.nsc.Main$.main(Main.scala:87)
[INFO]     at scala.tools.nsc.Main.main(Main.scala)
[INFO]     ... 6 more
[INFO] prepare-compile in 0 s
 

complete_stacktrace.txt (104K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Stack overflow during compilation

Brian Mosley
On 4/8/2010 12:15 AM, Rahul Pilani wrote:

> This is a shot in the dark, but I was wondering if anyone has seen
> something similar to the stacktrace below? We are getting a
> Stackoverflow exception when trying to compile some scala files on our
> build server. It works elsewhere, so I am at a loss as to what might
> be causing this there. We have tried using different JDKs and diferent
> scala versions but with the same result.
>
> I’ve attached the complete stacktrace if anyone is interested.
>
> Vital Stats about our build env:
> Linux i386 3G RAM
> Java 1.6.0.13
> Scala 2.7.7
> Maven 2.0.9
>
> [INFO] Compiling 16 source files to
> /home/build/.hudson/jobs/NaviTrunk/workspace/trunk/NaviHVUploader/target/classes
> at 1270690242026
> [INFO] java.lang.reflect.InvocationTargetException
> [INFO]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> [INFO]     at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> [INFO]     at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> [INFO]     at java.lang.reflect.Method.invoke(Method.java:597)
> [INFO]     at
> org_scala_tools_maven_executions.MainHelper.runMain(MainHelper.java:151)
> [INFO]     at
> org_scala_tools_maven_executions.MainWithArgsInFile.main(MainWithArgsInFile.java:26)
> [ERROR] Caused by: java.lang.StackOverflowError

I think it's been said that any compiler crash is a bug, so you should
probably file a bug report.


Reply | Threaded
Open this post in threaded view
|

Re: Stack overflow during compilation

Eric Willigers
In reply to this post by Rahul Pilani-3
Rahul Pilani wrote:

> This is a shot in the dark, but I was wondering if anyone has seen
> something similar to the stacktrace below? We are getting a
> Stackoverflow exception when trying to compile some scala files on our
> build server. It works elsewhere, so I am at a loss as to what might be
> causing this there. We have tried using different JDKs and diferent
> scala versions but with the same result.
>
> I’ve attached the complete stacktrace if anyone is interested.
>
> Vital Stats about our build env:
> Linux i386 3G RAM
> Java 1.6.0.13
> Scala 2.7.7
> Maven 2.0.9  

The type checking algorithm used by the compiler doesn't run in constant
stack space, hence you need to try one of the following
(a) Split your expressions into separate statements
(b) increase the JVM stack size when compiling
(c) change the compiler to reduce stack usage.


Here's a possible compiler change:-

The line (Typers.scala:3406) occurs many times. The function
   def typed(tree: Tree, pt: Type): Tree =
     typed(tree, EXPRmode, pt)
could be manually inlined (or automatically inlined in a later compiler
using an @inline annotation)

Reply | Threaded
Open this post in threaded view
|

Re: Re: Stack overflow during compilation

Jesse Eichar-2
I have experienced this as well but have not yet filed a bug report because my project is too big and I am having a hard time tracking down the problem so that I can make a good report.  If you could create a bug report with a program that triggers the bug it would be great.  Or if you don't want to take the time send me the program and I will file the bug report.

Jesse

On Thu, Apr 8, 2010 at 7:37 AM, Eric Willigers <[hidden email]> wrote:
Rahul Pilani wrote:
This is a shot in the dark, but I was wondering if anyone has seen something similar to the stacktrace below? We are getting a Stackoverflow exception when trying to compile some scala files on our build server. It works elsewhere, so I am at a loss as to what might be causing this there. We have tried using different JDKs and diferent
scala versions but with the same result.

I’ve attached the complete stacktrace if anyone is interested.

Vital Stats about our build env:
Linux i386 3G RAM
Java 1.6.0.13
Scala 2.7.7
Maven 2.0.9  

The type checking algorithm used by the compiler doesn't run in constant stack space, hence you need to try one of the following
(a) Split your expressions into separate statements
(b) increase the JVM stack size when compiling
(c) change the compiler to reduce stack usage.


Here's a possible compiler change:-

The line (Typers.scala:3406) occurs many times. The function
 def typed(tree: Tree, pt: Type): Tree =
   typed(tree, EXPRmode, pt)
could be manually inlined (or automatically inlined in a later compiler using an @inline annotation)


Reply | Threaded
Open this post in threaded view
|

Re: Re: Stack overflow during compilation

Martin Odersky


On Thu, Apr 8, 2010 at 8:47 AM, Jesse Eichar <[hidden email]> wrote:
I have experienced this as well but have not yet filed a bug report because my project is too big and I am having a hard time tracking down the problem so that I can make a good report.  If you could create a bug report with a program that triggers the bug it would be great.  Or if you don't want to take the time send me the program and I will file the bug report.

We are aware of that problem. The usual fix is to increase the VM's stack size using -Xss 2m, say. Different VM's have different default stack sizes, so it's quite possible that the problem occurs only in some settings.

I'll look into the possibility to reduce stack pressure by inlining.

Cheers

 -- Martin

 
Jesse


On Thu, Apr 8, 2010 at 7:37 AM, Eric Willigers <[hidden email]> wrote:
Rahul Pilani wrote:
This is a shot in the dark, but I was wondering if anyone has seen something similar to the stacktrace below? We are getting a Stackoverflow exception when trying to compile some scala files on our build server. It works elsewhere, so I am at a loss as to what might be causing this there. We have tried using different JDKs and diferent
scala versions but with the same result.

I’ve attached the complete stacktrace if anyone is interested.

Vital Stats about our build env:
Linux i386 3G RAM
Java 1.6.0.13
Scala 2.7.7
Maven 2.0.9  

The type checking algorithm used by the compiler doesn't run in constant stack space, hence you need to try one of the following
(a) Split your expressions into separate statements
(b) increase the JVM stack size when compiling
(c) change the compiler to reduce stack usage.


Here's a possible compiler change:-

The line (Typers.scala:3406) occurs many times. The function
 def typed(tree: Tree, pt: Type): Tree =
   typed(tree, EXPRmode, pt)
could be manually inlined (or automatically inlined in a later compiler using an @inline annotation)



Reply | Threaded
Open this post in threaded view
|

Re: Stack overflow during compilation

Daniel Sobral
In reply to this post by Rahul Pilani-3
Just a note here. Scala's type system is turing-complete, so it is possible to write code that will lead to infinite recursion in the compiler. 

See http://michid.wordpress.com/2010/01/29/scala-type-level-encoding-of-the-ski-calculus/ for more details.

On Thu, Apr 8, 2010 at 1:15 AM, Rahul Pilani <[hidden email]> wrote:
This is a shot in the dark, but I was wondering if anyone has seen something similar to the stacktrace below? We are getting a Stackoverflow exception when trying to compile some scala files on our build server. It works elsewhere, so I am at a loss as to what might be causing this there. We have tried using different JDKs and diferent
scala versions but with the same result.

I’ve attached the complete stacktrace if anyone is interested.

Vital Stats about our build env:
Linux i386 3G RAM
Java 1.6.0.13
Scala 2.7.7
Maven 2.0.9  

[INFO] Compiling 16 source files to /home/build/.hudson/jobs/NaviTrunk/workspace/trunk/NaviHVUploader/target/classes at 1270690242026
[INFO] java.lang.reflect.InvocationTargetException
[INFO]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[INFO]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[INFO]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[INFO]     at java.lang.reflect.Method.invoke(Method.java:597)
[INFO]     at org_scala_tools_maven_executions.MainHelper.runMain(MainHelper.java:151)
[INFO]     at org_scala_tools_maven_executions.MainWithArgsInFile.main(MainWithArgsInFile.java:26)
[ERROR] Caused by: java.lang.StackOverflowError
[INFO]     at scala.List.map(List.scala:809)
[INFO]     at scala.tools.nsc.transform.Erasure$$anon$1.apply(Erasure.scala:95)
[INFO]     at scala.tools.nsc.transform.Erasure$$anon$1.apply(Erasure.scala:64)
[INFO]     at scala.tools.nsc.transform.Erasure.transformInfo(Erasure.scala:320)
[INFO]     at scala.tools.nsc.transform.InfoTransform$Phase$$anon$1.transform(InfoTransform.scala:32)
[INFO]     at scala.tools.nsc.symtab.Symbols$Symbol.rawInfo(Symbols.scala:625)
[INFO]     at scala.tools.nsc.symtab.Symbols$Symbol.info(Symbols.scala:566)
[INFO]     at scala.tools.nsc.symtab.Symbols$Symbol.tpe(Symbols.scala:534)
[INFO]     at scala.tools.nsc.symtab.Symbols$Symbol.isStable(Symbols.scala:309)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer.typedApply$1(Typers.scala:2639)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:3257)
[INFO]     at scala.tools.nsc.transform.Erasure$Eraser.liftedTree1$1(Erasure.scala:662)
[INFO]     at scala.tools.nsc.transform.Erasure$Eraser.typed1(Erasure.scala:661)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:3358)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer.typedArg(Typers.scala:1649)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$typedArgs$2.apply(Typers.scala:1690)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$typedArgs$2.apply(Typers.scala:1690)
[INFO]     at scala.List$.map2(List.scala:333)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer.typedArgs(Typers.scala:1690)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer.doTypedApply(Typers.scala:1774)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer.typedApply$1(Typers.scala:2657)

... About 500 lines ...

[INFO]     at scala.List$.mapConserve(List.scala:317)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:1643)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:3084)
[INFO]     at scala.tools.nsc.transform.Erasure$Eraser.liftedTree1$1(Erasure.scala:662)
[INFO]     at scala.tools.nsc.transform.Erasure$Eraser.typed1(Erasure.scala:661)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:3358)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:3395)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:1598)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$19.apply(Typers.scala:1643)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$19.apply(Typers.scala:1643)
[INFO]     at scala.List$.loop$1(List.scala:300)
[INFO]     at scala.List$.mapConserve(List.scala:317)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:1643)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:3084)
[INFO]     at scala.tools.nsc.transform.Erasure$Eraser.liftedTree1$1(Erasure.scala:662)
[INFO]     at scala.tools.nsc.transform.Erasure$Eraser.typed1(Erasure.scala:661)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:3358)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:3395)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:1598)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$19.apply(Typers.scala:1643)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$19.apply(Typers.scala:1643)
[INFO]     at scala.List$.loop$1(List.scala:300)
[INFO]     at scala.List$.mapConserve(List.scala:317)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:1643)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:3084)
[INFO]     at scala.tools.nsc.transform.Erasure$Eraser.liftedTree1$1(Erasure.scala:662)
[INFO]     at scala.tools.nsc.transform.Erasure$Eraser.typed1(Erasure.scala:661)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:3358)
[INFO]     at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:3395)
[INFO]     at scala.tools.nsc.transform.Erasure$ErasureTransformer$$anonfun$transform$1.apply(Erasure.scala:1074)
[INFO]     at scala.tools.nsc.transform.Erasure$ErasureTransformer$$anonfun$transform$1.apply(Erasure.scala:1071)
[INFO]     at scala.tools.nsc.symtab.SymbolTable.atPhase(SymbolTable.scala:106)
[INFO]     at scala.tools.nsc.transform.Erasure$ErasureTransformer.transform(Erasure.scala:1071)
[INFO]     at scala.tools.nsc.ast.Trees$Transformer.transformUnit(Trees.scala:1479)
[INFO]     at scala.tools.nsc.transform.Transform$Phase.apply(Transform.scala:30)
[INFO]     at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:267)
[INFO]     at scala.tools.nsc.Global$GlobalPhase$$anonfun$run$1.apply(Global.scala:246)
[INFO]     at scala.tools.nsc.Global$GlobalPhase$$anonfun$run$1.apply(Global.scala:246)
[INFO]     at scala.Iterator$class.foreach(Iterator.scala:414)
[INFO]     at scala.collection.mutable.ListBuffer$$anon$1.foreach(ListBuffer.scala:266)
[INFO]     at scala.tools.nsc.Global$GlobalPhase.run(Global.scala:246)
[INFO]     at scala.tools.nsc.Global$Run.compileSources(Global.scala:574)
[INFO]     at scala.tools.nsc.Global$Run.compile(Global.scala:667)
[INFO]     at scala.tools.nsc.Main$.process(Main.scala:73)
[INFO]     at scala.tools.nsc.Main$.main(Main.scala:87)
[INFO]     at scala.tools.nsc.Main.main(Main.scala)
[INFO]     ... 6 more
[INFO] prepare-compile in 0 s
 



--
Daniel C. Sobral

I travel to the future all the time.
Reply | Threaded
Open this post in threaded view
|

Re: Re: Stack overflow during compilation

Rahul Pilani-3
In reply to this post by Jesse Eichar-2
Re: [scala-user] Re: Stack overflow during compilation For what its worth, we found the cause of the problem. We had recently patched the server and accidentally installed a non-SMP kernel. I had tried one of Eric’s suggestion (about increasing stack size), but that didn’t help. I kept getting the same stack trace, and it didn’t even seem that the extra stack space was making any difference. So when we installed the SMP kernel, the compilation started working again. This is obviously a bug in the JVM rather than scala, but I guess the large stack pressure in the scala compiler doesn’t help.

- Rahul

On 4/7/10 11:47 PM, "Jesse Eichar" <jeichar.w@...> wrote:

I have experienced this as well but have not yet filed a bug report because my project is too big and I am having a hard time tracking down the problem so that I can make a good report.  If you could create a bug report with a program that triggers the bug it would be great.  Or if you don't want to take the time send me the program and I will file the bug report.

Jesse

On Thu, Apr 8, 2010 at 7:37 AM, Eric Willigers <ewilligers@...> wrote:
Rahul Pilani wrote:
This is a shot in the dark, but I was wondering if anyone has seen something similar to the stacktrace below? We are getting a Stackoverflow exception when trying to compile some scala files on our build server. It works elsewhere, so I am at a loss as to what might be causing this there. We have tried using different JDKs and diferent
scala versions but with the same result.

I’ve attached the complete stacktrace if anyone is interested.

Vital Stats about our build env:
Linux i386 3G RAM
Java 1.6.0.13
Scala 2.7.7
Maven 2.0.9  

The type checking algorithm used by the compiler doesn't run in constant stack space, hence you need to try one of the following
(a) Split your expressions into separate statements
(b) increase the JVM stack size when compiling
(c) change the compiler to reduce stack usage.


Here's a possible compiler change:-

The line (Typers.scala:3406) occurs many times. The function
  def typed(tree: Tree, pt: Type): Tree =
    typed(tree, EXPRmode, pt)
could be manually inlined (or automatically inlined in a later compiler using an @inline annotation)