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 in codegen with recursive subtyping #40050

Closed
ararslan opened this issue Mar 15, 2021 · 2 comments · Fixed by #40095
Closed

Assertion in codegen with recursive subtyping #40050

ararslan opened this issue Mar 15, 2021 · 2 comments · Fixed by #40095
Assignees
Labels
bug Indicates an unexpected problem or unintended behavior compiler:codegen Generation of LLVM IR and native code

Comments

@ararslan
Copy link
Member

This works on Julia 1.0-1.3 but fails on 1.4-current master.

julia> struct A{T}
           x::T
       end

julia> struct B <: AbstractVector{A{B}}
       end

julia> A(B())
julia: /home/alex/Projects/julia/src/cgutils.cpp:611: llvm::Type* _julia_struct_to_llvm(jl_codegen_params_t*, jl_value_t*, jl_unionall_t*, bool*, bool): Assertion `isptr == jl_field_isptr(jst, i)' failed.

signal (6): Aborted
in expression starting at none:0
gsignal at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
abort at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
unknown function (ip: 0x7f1fe56bc489)
__assert_fail at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
_julia_struct_to_llvm at /home/alex/Projects/julia/src/cgutils.cpp:611
_julia_type_to_llvm at /home/alex/Projects/julia/src/cgutils.cpp:489
julia_type_to_llvm at /home/alex/Projects/julia/src/cgutils.cpp:499 [inlined]
mark_julia_type at /home/alex/Projects/julia/src/codegen.cpp:1325
emit_function at /home/alex/Projects/julia/src/codegen.cpp:6034
jl_emit_code at /home/alex/Projects/julia/src/codegen.cpp:7426
jl_emit_codeinst at /home/alex/Projects/julia/src/codegen.cpp:7471
_jl_compile_codeinst at /home/alex/Projects/julia/src/jitlayers.cpp:124
jl_generate_fptr at /home/alex/Projects/julia/src/jitlayers.cpp:352
jl_compile_method_internal at /home/alex/Projects/julia/src/gf.c:1978
jl_compile_method_internal at /home/alex/Projects/julia/src/gf.c:2244 [inlined]
_jl_invoke at /home/alex/Projects/julia/src/gf.c:2237 [inlined]
jl_apply_generic at /home/alex/Projects/julia/src/gf.c:2427
#38 at /home/alex/Projects/julia/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:220
jfptr_YY.38_54597 at /home/alex/Projects/julia/usr/lib/julia/sys.so (unknown line)
_jl_invoke at /home/alex/Projects/julia/src/gf.c:2245 [inlined]
jl_apply_generic at /home/alex/Projects/julia/src/gf.c:2427
with_repl_linfo at /home/alex/Projects/julia/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:462
_jl_invoke at /home/alex/Projects/julia/src/gf.c:2245 [inlined]
jl_apply_generic at /home/alex/Projects/julia/src/gf.c:2427
display at /home/alex/Projects/julia/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:213
display at /home/alex/Projects/julia/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:225
_jl_invoke at /home/alex/Projects/julia/src/gf.c:2245 [inlined]
jl_apply_generic at /home/alex/Projects/julia/src/gf.c:2427
display at ./multimedia.jl:328
_jl_invoke at /home/alex/Projects/julia/src/gf.c:2245 [inlined]
jl_apply_generic at /home/alex/Projects/julia/src/gf.c:2427
jl_apply at /home/alex/Projects/julia/src/julia.h:1739 [inlined]
jl_f__call_latest at /home/alex/Projects/julia/src/builtins.c:732
#invokelatest#2 at ./essentials.jl:721 [inlined]
invokelatest at ./essentials.jl:719 [inlined]
print_response at /home/alex/Projects/julia/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:247
#40 at /home/alex/Projects/julia/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:231
jfptr_YY.40_55737 at /home/alex/Projects/julia/usr/lib/julia/sys.so (unknown line)
_jl_invoke at /home/alex/Projects/julia/src/gf.c:2245 [inlined]
jl_apply_generic at /home/alex/Projects/julia/src/gf.c:2427
with_repl_linfo at /home/alex/Projects/julia/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:462
_jl_invoke at /home/alex/Projects/julia/src/gf.c:2245 [inlined]
jl_apply_generic at /home/alex/Projects/julia/src/gf.c:2427
print_response at /home/alex/Projects/julia/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:229
do_respond at /home/alex/Projects/julia/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:798
jfptr_do_respond_54708 at /home/alex/Projects/julia/usr/lib/julia/sys.so (unknown line)
_jl_invoke at /home/alex/Projects/julia/src/gf.c:2245 [inlined]
jl_apply_generic at /home/alex/Projects/julia/src/gf.c:2427
jl_apply at /home/alex/Projects/julia/src/julia.h:1739 [inlined]
jl_f__call_latest at /home/alex/Projects/julia/src/builtins.c:732
#invokelatest#2 at ./essentials.jl:721 [inlined]
invokelatest at ./essentials.jl:719 [inlined]
run_interface at /home/alex/Projects/julia/usr/share/julia/stdlib/v1.7/REPL/src/LineEdit.jl:2486
jfptr_run_interface_55466 at /home/alex/Projects/julia/usr/lib/julia/sys.so (unknown line)
_jl_invoke at /home/alex/Projects/julia/src/gf.c:2245 [inlined]
jl_apply_generic at /home/alex/Projects/julia/src/gf.c:2427
run_frontend at /home/alex/Projects/julia/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:1126
#44 at ./task.jl:406
jfptr_YY.44_53911 at /home/alex/Projects/julia/usr/lib/julia/sys.so (unknown line)
_jl_invoke at /home/alex/Projects/julia/src/gf.c:2245 [inlined]
jl_apply_generic at /home/alex/Projects/julia/src/gf.c:2427
jl_apply at /home/alex/Projects/julia/src/julia.h:1739 [inlined]
start_task at /home/alex/Projects/julia/src/task.c:859
Allocations: 2674 (Pool: 2665; Big: 9); GC: 0
[1]    9473 abort      /home/alex/Projects/julia/julia
@ararslan ararslan added bug Indicates an unexpected problem or unintended behavior compiler:codegen Generation of LLVM IR and native code labels Mar 15, 2021
@anaveragehuman
Copy link
Contributor

Bisect:

git bisect start
# bad: [96786e22ccabfdafd073122abb1fb69cea921e17] Set VERSION to 1.5.0 (#36876)
git bisect bad 96786e22ccabfdafd073122abb1fb69cea921e17
# good: [2d5741174ce3e6a394010d2e470e4269ca54607f] Set VERSION to 1.3.1 (#34151)
git bisect good 2d5741174ce3e6a394010d2e470e4269ca54607f
# good: [19a2b2e417fe80e83e2d2964db70451835abb4d4] add a note on checking for equality with singletons (#28700)
git bisect good 19a2b2e417fe80e83e2d2964db70451835abb4d4
# bad: [a741e815d913b92a211724140819899a5ea3de52] Force `clang`-based platforms to choose a cxx ABI
git bisect bad a741e815d913b92a211724140819899a5ea3de52
# good: [47e49abda3271d6c709dfc36fbca609d7be37e44] Merge branch 'master' into mb/fast-partitions
git bisect good 47e49abda3271d6c709dfc36fbca609d7be37e44
# good: [b0f0b2f9f765fc7e6e09323b95fbf45c0c7860b0] Revert "Fix `repr` on `DateTime` (#30200)"
git bisect good b0f0b2f9f765fc7e6e09323b95fbf45c0c7860b0
# bad: [eb5410a70318378224fdd151fa5dab7ef84a0286] Introduce `lu!` for `UmfpackLU` to make use of its symbolic factorization (#33738)
git bisect bad eb5410a70318378224fdd151fa5dab7ef84a0286
# bad: [acb7bd93fb2d5adbbabeaed9f39ab3c85495b02f] setindex: disallow breaking the object model (#34176)
git bisect bad acb7bd93fb2d5adbbabeaed9f39ab3c85495b02f
# bad: [0edadf1ce0bc31b590281d0cfcd87b25d6fdb884] Merge pull request #34128 from JuliaLang/jb/layoutopttweaks
git bisect bad 0edadf1ce0bc31b590281d0cfcd87b25d6fdb884
# bad: [b0431ce9215377d35036139fedaa35dc4f393ee4] Avoid overspecialization of the SparseMatrixCSC * Diagonal product (#33352)
git bisect bad b0431ce9215377d35036139fedaa35dc4f393ee4
# good: [b73fc63796a9b8d76165b56b0304b518cfa0b9ca] Provide a clearer error for at-threads for a, b (#34099)
git bisect good b73fc63796a9b8d76165b56b0304b518cfa0b9ca
# good: [fdcaa0674bbd3c2b3f73ddfebac83b46218f0f53]  check for `typemin(T)` in denominator of rational (#32572)
git bisect good fdcaa0674bbd3c2b3f73ddfebac83b46218f0f53
# bad: [3e34cbba01e5e4de272839de2494a33d0930e57a] Support Factorization \ UniformScaling (#33994)
git bisect bad 3e34cbba01e5e4de272839de2494a33d0930e57a
# bad: [630a551f426798bf02a1786f9470a262a0aca4af] layout: support pointers inlining into parents [NFCI] (#33886)
git bisect bad 630a551f426798bf02a1786f9470a262a0aca4af
# first bad commit: [630a551f426798bf02a1786f9470a262a0aca4af] layout: support pointers inlining into parents [NFCI] (#33886)

630a551 is the first bad commit, cc @vtjnash

@ararslan
Copy link
Member Author

Thanks for bisecting, @anaveragehuman!

@JeffBezanson JeffBezanson self-assigned this Mar 18, 2021
KristofferC pushed a commit that referenced this issue Mar 26, 2021
KristofferC pushed a commit that referenced this issue Apr 4, 2021
KristofferC pushed a commit that referenced this issue Apr 4, 2021
ElOceanografo pushed a commit to ElOceanografo/julia that referenced this issue May 4, 2021
antoine-levitt pushed a commit to antoine-levitt/julia that referenced this issue May 9, 2021
staticfloat pushed a commit that referenced this issue Dec 23, 2022
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 compiler:codegen Generation of LLVM IR and native code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants