Skip to content

Conversation

@adienes
Copy link
Member

@adienes adienes commented Sep 9, 2025

so as to avoid segfaults in the following type normalization

julia> @test Union{Tuple{}, Tuple{Int}, Tuple{UInt}} <: Union{
        Tuple{},
        Tuple{Int},
        Tuple{UInt},
        Tuple{UInt, Vararg{UInt}},
        Tuple{Int, Int, Vararg{Int}}
    }

[89686] signal 11 (2): Segmentation fault: 11
in expression starting at REPL[2]:1
jl_is_tuple_type at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-master/src/./julia.h:1835 [inlined]
merge_vararg_unions at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-master/src/jltypes.c:617
ijl_type_union at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-master/src/jltypes.c:674
jl_apply at /Users/julia/.julia/scratchspaces/a66863

@adienes adienes added types and dispatch Types, subtyping and method dispatch bugfix This change fixes an existing bug labels Sep 9, 2025
@test !(Tuple{Int,Vararg{Int,2}} <: Tuple{Int,Int,Int,Vararg{Int,1}})
@test Tuple{Int,Vararg{Int}} == Tuple{Int,Vararg{Int}}
@test (@UnionAll N Tuple{Int,Vararg{Int,N}}) == (@UnionAll N Tuple{Int,Vararg{Int,N}})
@test Union{Tuple{}, Tuple{Int}, Tuple{UInt}} <: Union{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@test Union{Tuple{}, Tuple{Int}, Tuple{UInt}} <: Union{
# This is a regression test against a nullcheck/segfault in jltypes.c
@test Union{Tuple{}, Tuple{Int}, Tuple{UInt}} <: Union{

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's also a correct test, right? I mean I'm not opposed to such a comment per se it just seems maybe unnecessary, especially since the cause of the crash is "typo" not "design failure"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Preferably it would have been added to the list of tests for this function, with a comment noting the issue number or PR, though both are commonly extracted from git praise anyways d4362e4#diff-90c3a7a047872b9929e6577e16ad589a77552d0de0400c98cf303b6b7204e683R8257

@vtjnash vtjnash merged commit b9e4274 into JuliaLang:master Sep 10, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix This change fixes an existing bug types and dispatch Types, subtyping and method dispatch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants