-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
extraneous type parameter induces segfault #27813
Comments
A milder form of this (assuming it's related) also happens without segfaulting.
|
I poked around a bit and I think this is a bug in cfunction inside functions that use jl_fptr_sparam. Stacktrace:
@pablosanjose Good observation. What happens is that |
@JeffBezanson I'll note that the solution is not always as easy to implement as removing the redundant type param, take these examples: julia> using Test
julia> module Unbound
f(args::T...) where {T} = 0
struct Foo{T}
f::Union{Nothing,Vector{T}}
end
struct Bar end
const Grok{T} = Union{Foo{T}, Bar} where {T}
g(x::Grok{T}) where {T} = 0
struct X{A,B} end
z(x::Union{X{A,B},Foo{A}}) where {A,B} = 0
end
Main.Unbound
julia> Test.detect_unbound_args(Unbound)
[1] g(x::Union{Main.Unbound.Bar, Main.Unbound.Foo{T}}) where T in Main.Unbound at REPL[15]:10
[2] z(x::Union{Main.Unbound.Foo{A}, Main.Unbound.X{A, B}}) where {A, B} in Main.Unbound at REPL[15]:13
[3] f(args::T...) where T in Main.Unbound at REPL[15]:2
[4] Main.Unbound.Foo(f::Union{Nothing, Vector{T}}) where T in Main.Unbound at REPL[15]:5 IIUC, the vararg function encounters a case where I've seen all of these examples in production code. Hopefully, these examples are helpful. |
Those are different from this (which doesn't use it at all). For those, the solution is usually to move the |
Found while working on #27736:
The text was updated successfully, but these errors were encountered: