-
-
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
signal (4): Illegal instruction, related to Julia 1.8 #47685
Comments
What is |
Despite the poor error report, I confirmed that running that packages tests failed in v1.8.3 and passes on master, so it might be fixed by one of these:
If you checkout RoME 4419a39acb8162b706d2ad3bcc2f4ebf3b5d3c14 and reapply the bad code, this could perhaps be bisected for backporting with a diff --git a/src/services/g2oParser.jl b/src/services/g2oParser.jl
index ae94713..8215f69 100644
--- a/src/services/g2oParser.jl
+++ b/src/services/g2oParser.jl
@@ -246,22 +246,22 @@ function stringG2o!(dfg::AbstractDFG,
error("unknown factor type $fnc")
end
-# _writeG2oLine(
-# _,
-# io,
-# dfg::AbstractDFG,
-# label,
-# i,
-# solveKey
-# ) = (close(io); error("exportG2o does not support $vartype, open an issue if you would like support"))
-
-function _writeG2oLinePose2(io, dfg::AbstractDFG, label::Symbol, i::Int, solveKey::Symbol)
+_writeG2oLine(
+ _,
+ io,
+ dfg::AbstractDFG,
+ label,
+ i,
+ solveKey
+) = (close(io); error("exportG2o does not support $vartype, open an issue if you would like support"))
+
+function _writeG2oLine(::Pose2, io, dfg::AbstractDFG, label::Symbol, i::Int, solveKey::Symbol)
# println("trying VERTEX_SE2")
(x,y,θ) = getPPESuggested(dfg, label, solveKey)
write(io, "VERTEX_SE2 $i $x $y $θ\n")
end
-function _writeG2oLinePose3(io, dfg::AbstractDFG, label::Symbol, i::Int, solveKey::Symbol)
+function _writeG2oLine(::Pose3, io, dfg::AbstractDFG, label::Symbol, i::Int, solveKey::Symbol)
# println("WHAT IS GOING ON")
Xc = getPPESuggested(dfg, label, solveKey)
p = getPoint(Pose3, Xc)
@@ -274,10 +274,7 @@ end
function _doG2oLoop(io, dfg, label, i, solveKey)
vartype = getVariableType(dfg, label)
- typename = string(typeof(vartype).name.name)
- # FIXME, HACK, WTF https://github.com/JuliaLang/julia/issues/46871#issuecomment-1318035929
- fnc = getfield(RoME, Symbol(:_writeG2oLine, typename))
- fnc(io, dfg, label, i, solveKey)
+ _writeG2oLine(vartype, io, dfg, label, i, solveKey)
end
function _writeG2oVertexes( |
tried to bisect, but I don't think this seems right :/
|
I have also seen such kind of crash in my code, with Julia 1.8.3. Not sure if this is helpful: if I ran the code with the vscode debugger, and set a breakpoint before the line where it was crashed, and step over line by line, the code finished normally. Otherwise, if I run the script in CLI or copy-paste in REPL, it crashed consistently.
|
Hi @vtjnash , yeah apologies for poor error report. It's been quite difficult to get down to a good MWE. The RoME test might also be hard to work with in this case (it's a package that I help maintain). I'd rather try find a better example than have you work through the RoME tests -- it has a lot of numerical tests. Let me understand better where you think the problem might be in Julia and I will try get a better MWE. The comment just above from qiaojunfeng helps confirm that there may actually be a bug here. Thanks for the pointers above! |
Looked a lot closer, and realized the bisect probably actually landed on #43990, but accidentally blamed the next commit (it reproduces most of the time, but not 100% reliablely). I thought this type of problem would get fixed by #46171 or #46375, but those were backported. This problem is what motivated the complete rewrite of this algorithm in #46920 (which was not backported, since it would be slightly difficult due to the addition of invoke-specific optimizations that are only on master). Looks like this is probably fixed on master though, presumably by that PR. -- reference notes to follow julia> using RoME
julia> Base.return_types(RoME.getVariableType, (RoME.DistributedFactorGraphs.GraphsDFGs.GraphsDFG{IncrementalInference.SolverParams, RoME.DistributedFactorGraphs.DFGVariable{T} where T<:RoME.DistributedFactorGraphs.InferenceVariable, RoME.DistributedFactorGraphs.DFGFactor{T, N} where N where T}, Symbol))
1-element Vector{Any}:
Union{Circular, Position} # bad
# want Any
julia> which(RoME.getVariableType, (RoME.DistributedFactorGraphs.GraphsDFGs.GraphsDFG{IncrementalInference.SolverParams, RoME.DistributedFactorGraphs.DFGVariable, RoME.DistributedFactorGraphs.DFGFactor}, Symbol)).specializations[1]
MethodInstance for DistributedFactorGraphs.getVariableType(::GraphsDFG{SolverParams, DFGVariable, DFGFactor}, ::Symbol).specializations[1]
MethodInstance for DistributedFactorGraphs.getVariableType(::GraphsDFG{SolverParams, DFGVariable, DFGFactor}, ::Symbol) # desired
julia> ans.cache
Core.CodeInstance(0x0000000000008326, 0x000000000000832a, Union{Circular, Position}, #undef, nothing, 0x00000509, 0x00000509, nothing, false, false, 0x01, Ptr{Nothing} @0, Ptr{Nothing} @0) # good
Core.CodeInstance(0x000000000000832b, 0xffffffffffffffff, Any, #undef, nothing, 0x00000109, 0x00000109, nothing, false, false, 0x01, Ptr{Nothing} @0, Ptr{Nothing} @0) # good
Core.CodeInstance(0x0000000000007fb1, 0xffffffffffffffff, Union{Circular, Position}, #undef, nothing, 0x000001aa, 0x000001aa, nothing, false, false, Ptr{Nothing} @0, Ptr{Nothing} @0, 0x01) # bad |
It is also appears to be somewhat traceable to |
Note due to bugs in Julia v1.8.3, the tests fail. JuliaLang/julia#47685 The tests work fine with a master branch julia JuliaLang/julia@c8ea33d
julia >= 1.8.4 fixs the crash due to JuliaLang/julia#47685
Should be fixed by #47741 |
Hi, tried to mention in a related and recently closed issue, but was likely missed. I'm still getting a similar Illegal instruction error on Julia 1.8.3 (after the #46882 fix).
The first line is the last printout to come from Julia-land before dropping down with the Signal (4) Illegal instruction:
The code is a simple case of dispatch:
Notice how the inner function print statement runs, but then this big error on the return nothing statement. Execution never makes it to the later
NEVER SEEN
print line. I'm a little confused.EDIT:
Also note Julia v1.8.3 I'm using here is freshly compiled from source. I was hoping 1.8.3 would fix the issue, but doesn't seem like it.
EDIT2: this was actually quite a tiring exercise, and ended up going with the following workaround:
Also, not sure if this is related, but I found another dispatch issue on Julia 1.8: when trying to add a dispatch from a downstream module, the multiple dispatch breaks down in some cases (used to work before 1.8). For example,
module First fnc(::MyType) end
; and then overloading fails:module Second import First.fnc; First.fnc(::AnotherType) end
.Originally posted by @dehann in #46871 (comment)
The text was updated successfully, but these errors were encountered: