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

Crash right before Stack Overflow with ntuple construction #17110

Closed
jballanc opened this issue Jun 25, 2016 · 8 comments
Closed

Crash right before Stack Overflow with ntuple construction #17110

jballanc opened this issue Jun 25, 2016 · 8 comments
Labels
bug Indicates an unexpected problem or unintended behavior
Milestone

Comments

@jballanc
Copy link
Contributor

This is occurring on v0.5 (Could be related to #17109)

If calling ntuple(f::F, n::Int) with n leads to a Stack Overflow, then calling with n-1 leads to a crash. For example:

julia> ntuple(x -> 1, 436521);
ERROR: StackOverflowError:
 in ntuple(::##35#36, ::Int64) at ./tuple.jl:61 (repeats 79994 times)

julia> ntuple(x -> 1, 436520);
fatal: error thrown and no exception handler available.
ErrorException("task switch not allowed from inside gc finalizer")
rec_backtrace at /Users/jballanc/Source/julia/src/stackwalk.c:83
record_backtrace at /Users/jballanc/Source/julia/src/task.c:228
jl_error at /Users/jballanc/Source/julia/src/builtins.c:42
jl_switchto at /Users/jballanc/Source/julia/src/task.c:380
yieldto at ./event.jl:89
unknown function (ip: 0x107c00bb0)
jl_call_method_internal at /Users/jballanc/Source/julia/src/./julia_internal.h:86
wait at ./event.jl:122
task_done_hook at ./task.jl:161
unknown function (ip: 0x315a1b5c9)
jl_call_method_internal at /Users/jballanc/Source/julia/src/./julia_internal.h:86
jl_apply at /Users/jballanc/Source/julia/src/./julia.h:1388
@StefanKarpinski StefanKarpinski added the bug Indicates an unexpected problem or unintended behavior label Aug 1, 2016
@StefanKarpinski StefanKarpinski added this to the 0.5.x milestone Aug 1, 2016
@pabloferz
Copy link
Contributor

pabloferz commented Aug 2, 2016

This one should be fixed after #17707

@KristofferC
Copy link
Member

KristofferC commented Aug 2, 2016

This specific example yes but probably not the more general segfault at StackOverflow - 1.

@pabloferz
Copy link
Contributor

Of course, but that is also reported in #17109, right?

@KristofferC
Copy link
Member

Oh sorry, I mixed the two of them up.

@jballanc
Copy link
Contributor Author

jballanc commented Aug 2, 2016

I had initially opened this separate from #17109 because there were some suggestive differences in the stack traces between the two. In other words, #17109 crashes in libunwind suggesting a possible off-by-one on frame creation, but this one crashes in a GC finalizer.

I suppose it might be possible that they are still the same (not knowledgeable enough myself to know if the GC finalizer would be called during stack unwind after a stack overflow), but regardless if this variant of the bug is no longer reproducible, I suppose it could be closed.

@yuyichao
Copy link
Contributor

yuyichao commented Aug 2, 2016

but this one crashes in a GC finalizer.

Why do you say that?

@jballanc
Copy link
Contributor Author

jballanc commented Aug 7, 2016

I was assuming this was the case based on this line from the stack trace:

ErrorException("task switch not allowed from inside gc finalizer")

But also, in this case the Julia process crashes with an uncaught exception, which is different than the segfault in #17109 (though, again, that doesn't mean they don't both have the same root cause).

@JeffBezanson
Copy link
Member

Closing as dup of #17109; this manifestation should be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

6 participants