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

Infinite non-cyclic recursion causing StackOverflow leads to crashed Julia session #39

Open
ghost opened this issue Dec 1, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@ghost
Copy link

ghost commented Dec 1, 2021

Infinite non-cyclic recursion causing StackOverflow leads to crashed Julia session.

I think this is because it throws another stackoverflow trying to print the exception's Salsa Stack.. 😅 Maybe we want to special-case the exception printing to not print the whole thing in the case of a StackOverflow, and/or to have some cut-off for the stack depth we'll print?

Or figure out how to do it in a loop instead of recursively or something?

Here's an example crash:

julia> using Salsa

julia> @derived foo(rt, x) = foo(rt, x+1)
foo (generic function with 1 method)

julia> rt = Runtime()
Salsa.Runtime(Salsa.DefaultStorage(0, ...))

julia> foo(rt, 1)
[ Info: DOUBLING SALSA TRACE FREELIST ON THREAD 1
[ Info: DOUBLING SALSA TRACE FREELIST ON THREAD 1
Internal error: encountered unexpected error in runtime:
StackOverflowError()
Internal error: encountered unexpected error in runtime:
StackOverflowError()
jl_subtype_env at /Applications/Julia-1.6.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.6.dylib (unknown line)
simple_join at /Applications/Julia-1.6.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.6.dylib (unknown line)
...

Full log from the crash: https://gist.github.com/rai-nhdaly/69cb50b2a97ed0bf00485e1858725ea7

@ghost ghost added the bug Something isn't working label Dec 1, 2021
@NHDaly NHDaly assigned NHDaly and unassigned NHDaly Dec 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant