Skip to content
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

Assertion failed in subtyping - Segfault #39565

Closed
saschatimme opened this issue Feb 8, 2021 · 8 comments · Fixed by #39604
Closed

Assertion failed in subtyping - Segfault #39565

saschatimme opened this issue Feb 8, 2021 · 8 comments · Fixed by #39604
Assignees
Labels
bug Indicates an unexpected problem or unintended behavior types and dispatch Types, subtyping and method dispatch
Milestone

Comments

@saschatimme
Copy link
Contributor

Starting from Julia-1.6-rc1 I get the following error

julia> using HomotopyContinuation
Assertion failed: (subtype_ab == 3 || subtype_ab == subtype || jl_has_free_typevars(a) || jl_has_free_typevars(b)), function jl_types_equal, file /Users/julia/buildbot/worker/package_macos64/build/src/subtype.c, line 1989.

signal (6): Abort trap: 6
in expression starting at REPL[3]:1
__pthread_kill at /usr/lib/system/libsystem_kernel.dylib (unknown line)
Allocations: 12531098 (Pool: 12526192; Big: 4906); GC: 15
[1]    58180 abort      julia-1.6

using the package worked under Julia-1.6-beta1.

Here are the steps I took and the exact versions which got installed. I know that this is not a small reproducible example, but I don't where to start to produce such a thing in this case.

julia> versioninfo()
Julia Version 1.6.0-rc1
Commit a58bdd9010 (2021-02-06 15:49 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin19.5.0)
  CPU: Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-11.0.1 (ORCJIT, skylake)
Environment:
  JULIA_NUM_THREADS = 4

(@v1.6) pkg> activate --temp
  Activating new environment at `/var/folders/9h/f_3bfpf17m7dg3bl6wxjb8ch0000gn/T/jl_L4snFQ/Project.toml`

(jl_L4snFQ) pkg> add HomotopyContinuation
    Updating registry at `~/.julia/registries/General`
    Updating git-repo `https://github.com/JuliaRegistries/General.git`
   Resolving package versions...
    Updating `/private/var/folders/9h/f_3bfpf17m7dg3bl6wxjb8ch0000gn/T/jl_L4snFQ/Project.toml`
  [f213a82b] + HomotopyContinuation v2.4.2
    Updating `/private/var/folders/9h/f_3bfpf17m7dg3bl6wxjb8ch0000gn/T/jl_L4snFQ/Manifest.toml`
  [79e6a3ab] + Adapt v3.2.0
  [fb37089c] + Arblib v0.3.0
  [4fba245c] + ArrayInterface v3.0.2
  [34da2185] + Compat v3.25.0
  [a8cc5b0e] + Crayons v4.0.4
  [9a962f9c] + DataAPI v1.5.1
  [864edb3b] + DataStructures v0.18.9
  [e2d170a0] + DataValueInterfaces v1.0.0
  [ffbed154] + DocStringExtensions v0.8.3
  [7c1d4256] + DynamicPolynomials v0.3.15
  [fdbdab4c] + ElasticArrays v1.2.6
  [6a86dc24] + FiniteDiff v2.8.0
  [59287772] + Formatting v0.4.2
  [f213a82b] + HomotopyContinuation v2.4.2
  [0e44f5e4] + Hwloc v1.2.0
  [615f187c] + IfElse v0.1.0
  [82899510] + IteratorInterfaceExtensions v1.0.0
  [692b3bcd] + JLLWrappers v1.2.0
  [8ac3fa9e] + LRUCache v1.2.0
  [bdcacae8] + LoopVectorization v0.11.2
  [291d046c] + MixedSubdivisions v1.1.0
  [102ac46a] + MultivariatePolynomials v0.3.12
  [d8a4904e] + MutableArithmetics v0.2.14
  [6fe1bfb0] + OffsetArrays v1.5.3
  [bac558e1] + OrderedCollections v1.3.3
  [d96e819e] + Parameters v0.12.2
  [08abe8d2] + PrettyTables v0.11.0
  [92933f4c] + ProgressMeter v1.4.1
  [01f381cc] + ProjectiveVectors v1.1.2
  [189a3867] + Reexport v0.2.0
  [ae029012] + Requires v1.1.2
  [476501e8] + SLEEFPirates v0.6.10
  [8e049039] + SemialgebraicSets v0.2.2
  [90137ffa] + StaticArrays v0.12.5
  [09ab397b] + StructArrays v0.4.2
  [3783bdb8] + TableTraits v1.0.0
  [bd369af6] + Tables v1.3.2
  [8290d209] + ThreadingUtilities v0.2.4
  [a2a6695c] + TreeViews v0.3.0
  [3a884ed6] + UnPack v1.0.2
  [3d5dd08c] + VectorizationBase v0.18.8
  [d9960996] + Arb_jll v200.1900.0+0
  [e134572f] + FLINT_jll v200.700.0+0
  [e33a78d0] + Hwloc_jll v2.4.0+0
  [2ce0c516] + MPC_jll v1.1.0+0
  [3428059b] + SymEngine_jll v0.6.0+1
  [0dad84c5] + ArgTools
  [56f22d72] + Artifacts
  [2a0f44e3] + Base64
  [ade2ca70] + Dates
  [8bb1440f] + DelimitedFiles
  [8ba89e20] + Distributed
  [f43a241f] + Downloads
  [9fa8497b] + Future
  [b77e0a4c] + InteractiveUtils
  [b27032c2] + LibCURL
  [76f85450] + LibGit2
  [8f399da3] + Libdl
  [37e2e46d] + LinearAlgebra
  [56ddb016] + Logging
  [d6f4376e] + Markdown
  [a63ad114] + Mmap
  [ca575930] + NetworkOptions
  [44cfe95a] + Pkg
  [de0858da] + Printf
  [3fa0cd96] + REPL
  [9a3f8284] + Random
  [ea8e919c] + SHA
  [9e88b42a] + Serialization
  [1a1011a3] + SharedArrays
  [6462fe0b] + Sockets
  [2f01184e] + SparseArrays
  [10745b16] + Statistics
  [fa267f1f] + TOML
  [a4e569a6] + Tar
  [8dfed614] + Test
  [cf7118a7] + UUIDs
  [4ec0a83e] + Unicode
  [781609d7] + GMP_jll
  [deac9b47] + LibCURL_jll
  [29816b5a] + LibSSH2_jll
  [3a97d323] + MPFR_jll
  [c8ffd9c3] + MbedTLS_jll
  [14a3606d] + MozillaCACerts_jll
  [83775a58] + Zlib_jll
  [8e850ede] + nghttp2_jll
  Progress [========================================>]  8/8
8 dependencies successfully precompiled in 69 seconds (43 already precompiled)

julia> using HomotopyContinuation
Assertion failed: (subtype_ab == 3 || subtype_ab == subtype || jl_has_free_typevars(a) || jl_has_free_typevars(b)), function jl_types_equal, file /Users/julia/buildbot/worker/package_macos64/build/src/subtype.c, line 1989.

signal (6): Abort trap: 6
in expression starting at REPL[3]:1
__pthread_kill at /usr/lib/system/libsystem_kernel.dylib (unknown line)
Allocations: 12531098 (Pool: 12526192; Big: 4906); GC: 15
[1]    58180 abort      julia-1.6
@KristofferC KristofferC added this to the 1.6 blockers milestone Feb 8, 2021
@maleadt
Copy link
Member

maleadt commented Feb 8, 2021

Dup of #34170, which was supposed to be fixed by 8f6432e (and is part of the RC).

$ julia --project -e 'using HomotopyContinuation'                                                                                                                                                                       
julia: /home/tim/Julia/src/julia/src/subtype.c:1989: jl_types_equal: Assertion `subtype_ab == 3 || subtype_ab == subtype || jl_has_free_typevars(a) || jl_has_free_typevars(b)' failed.

(rr) call jl_(a)
Tuple{typeof(Base.convert), Type{var"#s16"} where var"#s16"<:Union{Number, T}, MultivariatePolynomials.AbstractPolynomialLike{T}} where T
(rr) call jl_(b)
Tuple{typeof(Base.convert), Type{var"#s16"} where var"#s16"<:Union{Number, T}, MultivariatePolynomials.AbstractPolynomialLike{T}} where T

So this probably didn't happen on the beta only because it wasn't built with assertions, while the rc was.

@JeffBezanson
Copy link
Member

Those are not the same sort of non-normalized types from #34170 so this is probably not a dup.

@vtjnash
Copy link
Member

vtjnash commented Feb 8, 2021

It is also an entirely different assert.

#4  0x00007ffff7506d41 in jl_types_equal (a=0x7fffe70a7c10, b=0x7fffe8310730) at /data/vtjnash/julia/src/subtype.c:1940
1940            assert(subtype_ab == 3 || subtype_ab == subtype || jl_has_free_typevars(a) || jl_has_free_typevars(b));
(gdb) p subtype_ab
$1 = 1
(gdb) p subtype
$2 = 0
julia> a = Tuple{typeof(Base.convert), Type{var"#s16"} where var"#s16"<:Union{Number, T}, AbstractMatrix{T}} where T
Tuple{typeof(convert), Type{var"#s16"} where var"#s16"<:Union{Number, T}, AbstractMatrix{T}} where T

julia> b = Tuple{typeof(Base.convert), Type{var"#s16"} where var"#s16"<:Union{Number, T}, AbstractMatrix{T}} where T
Tuple{typeof(convert), Type{var"#s16"} where var"#s16"<:Union{Number, T}, AbstractMatrix{T}} where T

julia> a === b
true

julia> Type{a}
Type{Tuple{typeof(convert), Type{var"#s16"} where var"#s16"<:Union{Number, T}, AbstractMatrix{T}} where T}

julia> Type{b}
julia-debug: /data/vtjnash/julia/src/subtype.c:1940: jl_types_equal: Assertion `subtype_ab == 3 || subtype_ab == subtype || jl_has_free_typevars(a) || jl_has_free_typevars(b)' failed.

@vtjnash vtjnash added bug Indicates an unexpected problem or unintended behavior types and dispatch Types, subtyping and method dispatch labels Feb 8, 2021
@JeffBezanson
Copy link
Member

julia> S = Tuple{Type{<:Union{Number, T}}, Ref{T}} where T

julia> T = Tuple{Type{<:Union{Number, T}}, Ref{T}} where T

julia> T==S

@KristofferC
Copy link
Member

Pointing out here that it only seems to be the Mac .dmg that accidentally got assertions enabled.

@JeffBezanson JeffBezanson self-assigned this Feb 9, 2021
@vchuravy
Copy link
Member

vchuravy commented Feb 9, 2021

Pointing out here that it only seems to be the Mac .dmg that accidentally got assertions enabled.

@staticfloat can you look into why the buildbot pushed out a release with assertions?

@KristofferC
Copy link
Member

KristofferC commented Feb 9, 2021

We talked about it, seems it was just a human error which one that got picked for code signing and uploading.

@JeffBezanson
Copy link
Member

This bug seems to exist in the core subtyping algorithm at least since 1.0. So I think we should basically paper over this for now --- e.g. we can replace the obviously_egal check with just egal (how much slower could it be? come to think of it, I will check).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior types and dispatch Types, subtyping and method dispatch
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants