-
-
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
SIGSEGV and StackOverflow from dispatching on ::Type{T}, ::Array{Union{T,Missing},N}) #36185
Comments
On 1.5.0-beta1, I don't get any julia> for U in (:(Union{T, Missing}), :(Union{T, Nothing}),)
@eval function bar(::Type{T}, xs::Array{$U,N}) where {T,N}
T
end
end
ERROR: StackOverflowError:
Stacktrace:
[1] top-level scope at none:1
[2] eval(::Module, ::Any) at ./boot.jl:331
[3] top-level scope at REPL[4]:2
julia> @eval function bazz(::Type{T}, xs::Array{Union{T,Missing},N}) where {T,N}
T
end
bazz (generic function with 1 method)
julia> @eval function bar(::Type{T}, xs::Array{Union{T,Nothing},N}) where {T,N}
T
end
ERROR: StackOverflowError:
Stacktrace:
[1] top-level scope at none:1
[2] eval(::Module, ::Any) at ./boot.jl:331
[3] top-level scope at REPL[6]:1
julia> function bar(::Type{T}, xs::Array{Union{T,Nothing},N}) where {T,N}
T
end
ERROR: StackOverflowError:
Stacktrace:
[1] top-level scope at REPL[7]:1
julia> versioninfo()
Julia Version 1.5.0-beta1.0
Commit 6443f6c95a* (2020-05-28 17:42 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: AMD Ryzen 5 2600 Six-Core Processor
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-9.0.1 (ORCJIT, znver1)
Environment:
JULIA_NUM_THREADS = 6 |
Seems to be a stack overflow in type intersection:
The SEGV is probably just the usual issue with stack overflow (on mac os?). |
Correct I am on MacOS |
Interestingly, the stack overflow (on v1.4.1 on Linux) does not prevent the correct methods to be defined:
|
I can also reproduce this issue on my PC. But i just thought i should note that for U in (:(Union{T, Missing}), :(Union{T, Nothing}),)
@eval function bar(xs::Array{$U,N}, ::Type{T}) where {T,N}
T
end
end works. julia> bar(Union{Int, Missing}[1,2,3], Int)
Int64 julia> versioninfo()
Julia Version 1.4.2
Commit 44fa15b150* (2020-05-23 18:35 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: Intel(R) Core(TM) i3-5005U CPU @ 2.00GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-8.0.1 (ORCJIT, broadwell)
|
I tried a few of the things that should have segfaulted, but don't seem to. I wonder if the segfaults got fixed in the linked PRs and if this issue can be closed. |
The MWE still fails in typeintersection |
EDIT: MWE from below
Original text:
If I do
Then julia
SIGSEGV
's (Address boundary error)When I do:
I get a
StackOverflowError
When I do:
I am back to crashing out with
SIGSEGV
's (Address boundary error)But if i do:
then it is fine.
But that is a different expression
as is
This is on
Version 1.6.0-DEV.184 (2020-06-06)
The text was updated successfully, but these errors were encountered: