Skip to content

[release 1.6] Infinite loop in subtype checking code #46929

@olynch

Description

@olynch

I get an infinite loop that prints out:

exists_subtype at /buildworker/worker/package_linux64/build/src/subtype.c:1426 [inlined]
forall_exists_subtype at /buildworker/worker/package_linux64/build/src/subtype.c:1454
subtype_in_env_ at /buildworker/worker/package_linux64/build/src/subtype.c:1909
subtype_bounds_in_env at /buildworker/worker/package_linux64/build/src/subtype.c:1919 [inlined]
try_subtype_in_env at /buildworker/worker/package_linux64/build/src/subtype.c:2194 [inlined]
intersect_var at /buildworker/worker/package_linux64/build/src/subtype.c:2307
intersect at /buildworker/worker/package_linux64/build/src/subtype.c:3015
intersect_union at /buildworker/worker/package_linux64/build/src/subtype.c:2164
intersect at /buildworker/worker/package_linux64/build/src/subtype.c:3028
intersect_all at /buildworker/worker/package_linux64/build/src/subtype.c:3190
intersect_aside at /buildworker/worker/package_linux64/build/src/subtype.c:2141
var_lt at /buildworker/worker/package_linux64/build/src/subtype.c:589
subtype at /buildworker/worker/package_linux64/build/src/subtype.c:1256
exists_subtype at /buildworker/worker/package_linux64/build/src/subtype.c:1426 [inlined]
forall_exists_subtype at /buildworker/worker/package_linux64/build/src/subtype.c:1454
subtype_in_env_ at /buildworker/worker/package_linux64/build/src/subtype.c:1909
subtype_bounds_in_env at /buildworker/worker/package_linux64/build/src/subtype.c:1919 [inlined]
try_subtype_in_env at /buildworker/worker/package_linux64/build/src/subtype.c:2194 [inlined]
....

when I run the following command:

julia --project=. MFE.jl

in this branch. I managed to work around this error with this commit. Basically, my understanding of this bug is that it happens when the type of the argument to copy is partially known; if it is fully known or not known at all, then dispatch works correctly, but somehow the partial knowledge that comes from copy being called with a type that's partially inferred causes the julia compiler to freak out.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behaviortypes and dispatchTypes, subtyping and method dispatch

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions