-
-
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
Call stack is very confused on error #16578
Comments
The error message seems to be "stuck" at line 50 even when I have other errors happening at other places in the function. |
Does it work with ./julia -O0? |
No, error message is identical with -O0 |
Not sure if this is related, but I've been seeing a regression in stack traces when loading modules Current master: julia> reload("FlatBuffers")
ERROR: LoadError: syntax: missing comma or ) in argument list
in include_from_node1(::String) at ./loading.jl:426
in eval(::Module, ::Any) at ./boot.jl:225
in require(::Symbol) at ./loading.jl:357
in reload(::String) at ./loading.jl:308
in eval(::Module, ::Any) at ./boot.jl:225
in macro expansion at ./REPL.jl:92 [inlined]
in (::Base.REPL.##1#2{Base.REPL.REPLBackend})() at ./event.jl:46
while loading /Users/jacobquinn/.julia/v0.5/FlatBuffers/src/FlatBuffers.jl, in expression starting on line 1 Julia 0.4.1 julia> include("/Users/jacobquinn/.julia/v0.5/FlatBuffers/src/FlatBuffers.jl")
ERROR: LoadError: syntax: missing comma or ) in argument list
in include at /Users/jacobquinn/julia4/lib/julia/sys.dylib
in include_from_node1 at /Users/jacobquinn/julia4/lib/julia/sys.dylib
while loading /Users/jacobquinn/.julia/v0.5/FlatBuffers/src/FlatBuffers.jl, in expression starting on line 141 |
Since I don't have a good repo for this right now, I will close this and reopen if this happens again. |
After a colleague also reported getting strange backtrace errros with the Pkg.clone("https://github.com/KristofferC/ContMechTensors.jl")
using ContMechTensors
a = zero(Vec{3, Float64})
function f(a)
dot(a,a)
print("hello...")
a[5] # Will error here with BoundsError
end The stacktrace is
The call to |
Note that it is also reporting the error at |
Running |
What's |
You mean on |
For any |
https://gist.github.com/KristofferC/964c4920d170b517569306d6107ad2ed One with the above example and one when using |
Doing something like: function f_dot(a)
dot(a,a)
dot(a,a)
dot(a,a)
dot(a,a)
a[5] # Will error here with BoundsError
end gives
Corresponding |
The line numbers on the inlined functions seem to be weird as well since they call the same function but have different line numbers. |
Can you check if this patch fixes it? diff --git a/base/inference.jl b/base/inference.jl
index 79edb33..28ae824 100644
--- a/base/inference.jl
+++ b/base/inference.jl
@@ -2045,7 +2045,7 @@ function expr_cannot_delete(ex::Expr)
# `Expr(:inbounds)` and `Expr(:boundscheck)`. However, it is still possible
# to have these embeded in other expressions (e.g. `return @inbounds ...`)
# so we check recursively if there's a matching expression
- (ex.head === :inbounds || ex.head === :boundscheck) && return true
+ (ex.head === :inbounds || ex.head === :boundscheck || ex.head === :meta) && return true
for arg in ex.args
isa(arg, Expr) && expr_cannot_delete(arg::Expr) && return true
end |
It does not from what I can see. |
OK, I think I find a fix, will write a test and submit a PR. |
* Preserve meta node and line number info during dead code elimination * Insert `:push_loc` and `:pop_loc` in pairs during lowering Fix #16578
* Preserve meta node and line number info during dead code elimination * Insert `:push_loc` and `:pop_loc` in pairs during lowering Fix #16578
* Preserve meta node and line number info during dead code elimination * Insert `:push_loc` and `:pop_loc` in pairs during lowering Fix JuliaLang#16578
I have lately been getting very confusing call stacks in the error messages that make no sense from how I know my calls are being made.
For example:
There are many problems with this call stack:
zero
inContMechTensors.jl
callsintf
which is not true.assemble!
callsintf
directly./intf_dual.jl:50
which runs a commandfill!(fe_u, zero(Vec{dim, T}))
so the call above atzero
makes sense, if that is where the error actually happened, but it isn't.75
where I havea[ξ⟂_node_dofs]
andξ⟂_node_dofs
are the indices which access the array OOB. However, at this line there is no calls tozero
at all so how did those get into the call stack?This is from my research code so it is quite messy to get running so I don't have a MWE right now. I could try to check if it was introduced in #16335 if that would help?
The text was updated successfully, but these errors were encountered: