-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scala 2.13.0-M4: StackoverflowError during compilation #11030
Comments
does increasing the JVM stack size setting make the problem go away? we need to distinguish whether it's actually consuming unbounded stack (bug), or just is consuming a little more stack than it used to and happened to exceed the limit on this particular codebase with your particular JVM settings (not a bug) |
@SethTisue I tried It seems using two classes extending MessageCodec[Seq[A]] and MessageCodec[IndexSeq[A]] at the same time causes this issue: If I use only one of them, this error doesn't occur. |
okay. are you able to reproduce it in a self-contained piece of code that we could incorporate into our regression tests...? |
ok. I'll try. |
note that even on 2.12.6, compiling with
|
@SethTisue interesting, but i guess it's unrelated to this issue because even if I remove Logger macro code, the problem still happens. Could you try 'codec/compile' ? |
OK. It seems I need to fix the above cyclic reference first to see the typer debug log in codec project. |
whether it's related or not, I don't know (especially since we don't have a minimization yet) |
(see my comment, which I wrote before I'd seen yours, even though it ended up showing up after it on GitHub) |
@SethTisue
Sample.scala
|
|
It seems this two lines are good enough to reproduce this recursive type error:
|
This error didn't happen if the case class is changed to a regular class. |
At least I've found a workaround for my project (using regular classes instead of case classes) to avoid this stackoverflow error. |
it's interesting and perhaps useful to know what the minimization is with |
I've tried but it's bit hard to find minimization to cause StackOverflowError. |
similar StackOverflow error in fs2
|
Maybe #10911 which has PR? |
Assigning to you, @joroKr21, assuming scala/scala#7580 fixes this one too |
Sounds like a bug in |
Most likely unrelated but very similar bug (and the only google result) - but I've managed to get the |
I don’t think it needs a separate issue. Note that we’re not going to be able to prioritize fixing bugs in -Y flags. The typer debug mechanism is known to have issues with cycles and it’s not easy to fix |
Understood - thanks for clarifying :) |
Scala 2.13.0-M4 shows the following StackOverflowError, which never happened in Scala 2.11, 2.12:
https://travis-ci.org/wvlet/airframe/builds/405575941 (Only Scala 2.13.0-M4 build fails)
https://travis-ci.org/wvlet/airframe/jobs/405575946 (StackOverflowError in Scala 2.13.0-M4):
How to reproduce:
The cause of the error:
If I remove the following lines from the code, the error disappearred:
https://github.com/wvlet/airframe/blob/f16ea745e545b82d4b47e5725600ff325e2c6d44/airframe-codec/src/main/scala/wvlet/airframe/codec/MessageCodecFactory.scala#L60-L69
It seems there might be some cyclic references in the code, or already traversed references are not properly cached in the compiler side.
The text was updated successfully, but these errors were encountered: