-
-
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
Fix #19655 (TypeError on empty stacktrace) #19656
Conversation
This should probably be backported |
@@ -144,7 +144,7 @@ doesn't return C functions, but this can be enabled.) When called without specif | |||
trace, `stacktrace` first calls `backtrace`. | |||
""" | |||
function stacktrace(trace::Vector{Ptr{Void}}, c_funcs::Bool=false) | |||
stack = vcat(map(lookup, trace)...)::StackTrace | |||
stack = vcat(StackTrace(), map(lookup, trace)...)::StackTrace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would: StackTrace[ lookup(x) for x in trace ]
make more sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That wouldn't concatenate the results of lookup
together.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is essentially a "flatten" operation.
AppVeyor failure seems like an unrelated network issue. |
Bump. |
Wrote a test but setting up a new computer so I have to wait for a Julia build. |
I don't understand what's happening with the CI here. |
doc build failure from #19268 |
Ah but that was only on Travis, the AppVeyor failures look like the newly-added tests didn't work there. |
Dang; I decided to use |
14dabf0
to
59ae37b
Compare
let | ||
# not in a `catch`, so should return an empty StackTrace | ||
st = stacktrace(empty!(backtrace())) | ||
println(st) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should probably take this part out?
edit: or print to an IOBuffer and compare the contents to an expected string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dammit. Sorry.
No need to print and check, the tests below that check for all relevant information.
59ae37b
to
7a8d0f2
Compare
The issue was that
vcat(StackFrame[]...)
givesAny[]
, notStackFrame[]
.