-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Profile printer can stack overflow #30365
Comments
Do you have a reproducible test case? It seems to suggest there are circumstances where one can get a cycle in the tree, which shouldn't happen. Either that, or you're profiling some really deeply nested code? |
I don't really have a reproducer. I was profiling some compiler stuff. It is fairly deeply nested, but not eggregiously so. Also goes away if I reduce the profile interval. |
Maybe just |
I don't think this is #28648. A stack depth of 9990 doesn't seem all that deep (remember too that this is after expanding inlining frames too, although after dropping C frames) and that's certainly plausible within an inference run. I'm just a bit surprised that 19989 moderate-sized frames would overflow the stack, since |
Seems to show up on the buildbots too: https://build.julialang.org/#/builders/13/builds/458/steps/2/logs/stdio |
julia> using Profile
julia> f(a) = g(a); g(a) = h(a); h(a) = i(a); i(a) = j(a); j(a) = k(a); k(a) = l(a); l(a) = m(a); m(a) = (a == 0 ? "$a" : f(a - 1));
julia> @profile for i = 1:10; f(10000); end
julia> Profile.print()
┌ Warning: The profile data buffer is full; profiling probably terminated
│ before your program finished. To profile for longer runs, call
│ `Profile.init()` with a larger buffer and/or larger delay.
└ @ Profile /data/vtjnash/julia/usr/share/julia/stdlib/v1.2/Profile/src/Profile.jl:312
ERROR: StackOverflowError:
Stacktrace:
[1] (::getfield(Profile, Symbol("#cleanup!#21")))(::Profile.StackFrameTree{Base.StackTraces.StackFrame}) at /data/vtjnash/julia/usr/share/julia/stdlib/v1.2/Profile/src/Profile.jl:552
[2] foreach(::getfield(Profile, Symbol("#cleanup!#21")), ::Base.ValueIterator{Dict{Base.StackTraces.StackFrame,Profile.StackFrameTree{Base.StackTraces.StackFrame}}}) at ./abstractarray.jl:1868
... (the last 2 lines are repeated 9276 more times)
[18555] (::getfield(Profile, Symbol("#cleanup!#21")))(::Profile.StackFrameTree{Base.StackTraces.StackFrame}) at /data/vtjnash/julia/usr/share/julia/stdlib/v1.2/Profile/src/Profile.jl:552
[18556] tree!(::Profile.StackFrameTree{Base.StackTraces.StackFrame}, ::Array{UInt64,1}, ::Dict{UInt64,Array{Base.StackTraces.StackFrame,1}}, ::Bool) at /data/vtjnash/julia/usr/share/julia/stdlib/v1.2/Profile/src/Profile.jl:555
[18557] tree(::Base.TTY, ::Array{UInt64,1}, ::Dict{UInt64,Array{Base.StackTraces.StackFrame,1}}, ::Int64, ::Profile.ProfileFormat) at /data/vtjnash/julia/usr/share/julia/stdlib/v1.2/Profile/src/Profile.jl:585
[18558] print(::Base.TTY, ::Array{UInt64,1}, ::Dict{UInt64,Array{Base.StackTraces.StackFrame,1}}, ::Profile.ProfileFormat, ::Symbol) at /data/vtjnash/julia/usr/share/julia/stdlib/v1.2/Profile/src/Profile.jl:147
[18559] print(::Base.TTY, ::Array{UInt64,1}, ::Dict{UInt64,Array{Base.StackTraces.StackFrame,1}}) at /data/vtjnash/julia/usr/share/julia/stdlib/v1.2/Profile/src/Profile.jl:134
[18560] #print#5(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Array{UInt64,1}, ::Dict{UInt64,Array{Base.StackTraces.StackFrame,1}}) at /data/vtjnash/julia/usr/share/julia/stdlib/v1.2/Profile/src/Profile.jl:164
[18561] print at /data/vtjnash/julia/usr/share/julia/stdlib/v1.2/Profile/src/Profile.jl:164 [inlined] (repeats 2 times) |
fixed by #31893 |
The text was updated successfully, but these errors were encountered: