Skip to content
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

Fix unknown compiler crash printing 'null' #780

Merged
merged 2 commits into from
Jan 15, 2025

Conversation

jiribenes
Copy link
Contributor

@jiribenes jiribenes commented Jan 15, 2025

Resolves the Effect Compiler Crash: null part of #760.
The actual problem there was that e.getMessage can return null and it does for... StackOverflowException 🥳.
Looking at the docs, it's recommended to use e.toString.

While I was at it, I modified stack trace printing, now we do it properly by using .printStackTrace.

This is very related to #731, I just want to get this out quickly to unblock other problems.

Comment on lines +118 to +121
def getStackTrace(e: Throwable): String =
val stringWriter = new java.io.StringWriter()
e.printStackTrace(new java.io.PrintWriter(stringWriter))
stringWriter.toString
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part is essentially cherry-picked from the discussion in @JakubSchwenkbeck's #731. Thanks!

@dvdvgt dvdvgt merged commit 26c642d into master Jan 15, 2025
2 checks passed
@dvdvgt dvdvgt deleted the fix/compiler-runfrontend-crash-null branch January 15, 2025 19:53
dvdvgt pushed a commit that referenced this pull request Jan 17, 2025
Resolves the `Effect Compiler Crash: null` part of #760.
The actual problem there was that `e.getMessage` can return `null` and
it does for... _StackOverflowException_ 🥳.
Looking at the docs, it's recommended to use `e.toString`.

While I was at it, I modified stack trace printing, now we do it
properly by using `.printStackTrace`.

This is very related to #731, I just want to get this out quickly to
unblock other problems.
EveEme pushed a commit to EveEme/effekt that referenced this pull request Jan 20, 2025
Resolves the `Effect Compiler Crash: null` part of effekt-lang#760.
The actual problem there was that `e.getMessage` can return `null` and
it does for... _StackOverflowException_ 🥳.
Looking at the docs, it's recommended to use `e.toString`.

While I was at it, I modified stack trace printing, now we do it
properly by using `.printStackTrace`.

This is very related to effekt-lang#731, I just want to get this out quickly to
unblock other problems.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants