Skip to content

Commit

Permalink
Merge pull request JuliaLang#21776 from JuliaLang/jb/remote_domainerror
Browse files Browse the repository at this point in the history
fix error in `showerror` with backtraces from CapturedExceptions
  • Loading branch information
JeffBezanson authored May 11, 2017
2 parents 7ea1620 + ba87e99 commit df443c1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions base/stacktraces.jl
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ end

lookup(pointer::UInt) = lookup(convert(Ptr{Void}, pointer))

# allow lookup on already-looked-up data for easier handling of pre-processed frames
lookup(s::StackFrame) = StackFrame[s]
lookup(s::Tuple{StackFrame,Int}) = StackFrame[s[1]]

"""
stacktrace([trace::Vector{Ptr{Void}},] [c_funcs::Bool=false]) -> StackTrace
Expand Down
12 changes: 12 additions & 0 deletions test/distributed_exec.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1498,6 +1498,18 @@ if true
end
@test x == map(_->sin(2), 1:2)

let thrown = false
try
remotecall_fetch(sqrt, 2, -1)
catch e
thrown = true
b = IOBuffer()
showerror(b, e)
@test contains(String(take!(b)), "sqrt will only return")
end
@test thrown
end

# Testing clear!
function setup_syms(n, pids)
syms = []
Expand Down

0 comments on commit df443c1

Please sign in to comment.