Skip to content

Commit

Permalink
Add error-handling for malformed Type Tuples that fail to print.
Browse files Browse the repository at this point in the history
This apparently can happen sometimes, see:
JuliaLang/julia#38195
  • Loading branch information
NHDaly committed Nov 27, 2020
1 parent 8e32013 commit be2f29b
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/parcel_snoopi_deep.jl
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,16 @@ function frame_name(mi::Core.Compiler.MethodInstance)
end
# Special printing for Type Tuples so they're less ugly in the FlameGraph
function frame_name(name, @nospecialize(tt::Type{<:Tuple}))
io = IOBuffer()
Base.show_tuple_as_call(io, name, tt)
v = String(take!(io))
return v
try
io = IOBuffer()
Base.show_tuple_as_call(io, name, tt)
v = String(take!(io))
return v
catch e
e isa InterruptException && rethrow()
@warn "Error displaying frame: $e"
return name
end
end

# NOTE: The "root" node doesn't cover the whole profile, because it's only the _complement_
Expand Down

0 comments on commit be2f29b

Please sign in to comment.