Open fatteneder opened 2 weeks ago
This actually seems to be a duplicate of https://github.com/JuliaLang/julia/issues/40009, and has been fixed by https://github.com/JuliaLang/julia/pull/52999 on the latest master.
I don't think there's anything wrong with the crash.
After calling totalsize(B)
, it will run into the sum
loop, and call totalsize(Vector{A})
, and then evaluate the if
sentence. Then hastrait(Vector{A})
will call the second method, i.e., = hastrait(typeof(Vector{A})) = hastrait(DataType)
. However, typeof(DataType)
also returns DataType
, and thus the recursive call will never stop, and throws an error finally.
It seems that everything makes sense and it's not a bug.
The case is slightly different to #40009, since the recursive will require incremental memory space and will crash, but the cases in #40009 not.
MWE
The line
hastrait(t) = hastrait(typeof(t))
is wrong and should be fixed withhastrait(::Type{T}) where T = nothing
, but the crash should not happen.Stack trace
rr trace uploaded to https://julialang-dumps.s3.amazonaws.com/reports/2024-06-16T10-41-10-fatteneder.tar.zst
StackOverflowError
.and installed with
juliaup
.