-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
infinite loop in C code when trying to add a method #54516
Comments
When trying to precompile LaurentPolynomials.jl: julia> using LaurentPolynomials
Precompiling LaurentPolynomials...
^C Interrupted: Exiting precompilation...
Info [ Info: Waiting for another process (pid: 497792) to finish precompiling LaurentPolynomials [10b2801c-d482-41ed-a506-4a825c59e3da]. Pidfile: /home/nsajko/.julia/compiled/v1.12/LaurentPolynomials/9eoeD_u6Ef1.ji.pidfile
Given LaurentPolynomials was explicitly requested, output will be shown live
[497799] signal 2: Interrupt
[ Info: Precompiling LaurentPolynomials [10b2801c-d482-41ed-a506-4a825c59e3da]
in expression starting at /home/nsajko/.julia/packages/LaurentPolynomials/Vje2Z/src/LaurentPolynomials.jl:901
jl_has_bound_typevars at /cache/build/builder-amdci5-3/julialang/julia-master/src/jltypes.c:221
finish_unionall at /cache/build/builder-amdci5-3/julialang/julia-master/src/subtype.c:3015
intersect_unionall_ at /cache/build/builder-amdci5-3/julialang/julia-master/src/subtype.c:3194
intersect_unionall at /cache/build/builder-amdci5-3/julialang/julia-master/src/subtype.c:3265
intersect at /cache/build/builder-amdci5-3/julialang/julia-master/src/subtype.c:3865
intersect_all at /cache/build/builder-amdci5-3/julialang/julia-master/src/subtype.c:4126
jl_type_intersection_env_s at /cache/build/builder-amdci5-3/julialang/julia-master/src/subtype.c:4348
jl_typemap_intersection_node_visitor at /cache/build/builder-amdci5-3/julialang/julia-master/src/typemap.c:543
jl_typemap_intersection_visitor at /cache/build/builder-amdci5-3/julialang/julia-master/src/typemap.c:812
jl_typemap_intersection_memory_visitor at /cache/build/builder-amdci5-3/julialang/julia-master/src/typemap.c:500
jl_typemap_intersection_visitor at /cache/build/builder-amdci5-3/julialang/julia-master/src/typemap.c:802
get_intersect_matches at /cache/build/builder-amdci5-3/julialang/julia-master/src/gf.c:1567 [inlined]
jl_method_table_activate at /cache/build/builder-amdci5-3/julialang/julia-master/src/gf.c:2039
ijl_method_table_insert at /cache/build/builder-amdci5-3/julialang/julia-master/src/gf.c:2233
ijl_method_def at /cache/build/builder-amdci5-3/julialang/julia-master/src/method.c:1305
eval_methoddef at /cache/build/builder-amdci5-3/julialang/julia-master/src/interpreter.c:112
eval_body at /cache/build/builder-amdci5-3/julialang/julia-master/src/interpreter.c:619
jl_interpret_toplevel_thunk at /cache/build/builder-amdci5-3/julialang/julia-master/src/interpreter.c:865
jl_toplevel_eval_flex at /cache/build/builder-amdci5-3/julialang/julia-master/src/toplevel.c:969
jl_eval_module_expr at /cache/build/builder-amdci5-3/julialang/julia-master/src/toplevel.c:215 [inlined]
jl_toplevel_eval_flex at /cache/build/builder-amdci5-3/julialang/julia-master/src/toplevel.c:762
jl_toplevel_eval_flex at /cache/build/builder-amdci5-3/julialang/julia-master/src/toplevel.c:909
jl_toplevel_eval_flex at /cache/build/builder-amdci5-3/julialang/julia-master/src/toplevel.c:909
ijl_toplevel_eval at /cache/build/builder-amdci5-3/julialang/julia-master/src/toplevel.c:980
ijl_toplevel_eval_in at /cache/build/builder-amdci5-3/julialang/julia-master/src/toplevel.c:1022
eval at ./boot.jl:432 [inlined]
include_string at ./loading.jl:2591
_include at ./loading.jl:2651
include at ./Base.jl:559 [inlined]
include_package_for_output at ./loading.jl:2769
jfptr_include_package_for_output_68716.1 at /home/nsajko/tmp/jl/jl/julia-6c17db1ba1/lib/julia/sys.so (unknown line)
jl_apply at /cache/build/builder-amdci5-3/julialang/julia-master/src/julia.h:2189 [inlined]
do_call at /cache/build/builder-amdci5-3/julialang/julia-master/src/interpreter.c:127
eval_value at /cache/build/builder-amdci5-3/julialang/julia-master/src/interpreter.c:224
eval_stmt_value at /cache/build/builder-amdci5-3/julialang/julia-master/src/interpreter.c:175 [inlined]
eval_body at /cache/build/builder-amdci5-3/julialang/julia-master/src/interpreter.c:660
jl_interpret_toplevel_thunk at /cache/build/builder-amdci5-3/julialang/julia-master/src/interpreter.c:865
jl_toplevel_eval_flex at /cache/build/builder-amdci5-3/julialang/julia-master/src/toplevel.c:969
jl_toplevel_eval_flex at /cache/build/builder-amdci5-3/julialang/julia-master/src/toplevel.c:909
ijl_toplevel_eval at /cache/build/builder-amdci5-3/julialang/julia-master/src/toplevel.c:980
ijl_toplevel_eval_in at /cache/build/builder-amdci5-3/julialang/julia-master/src/toplevel.c:1022
eval at ./boot.jl:432 [inlined]
include_string at ./loading.jl:2591
include_string at ./loading.jl:2601 [inlined]
exec_options at ./client.jl:323
_start at ./client.jl:533
jfptr__start_70211.1 at /home/nsajko/tmp/jl/jl/julia-6c17db1ba1/lib/julia/sys.so (unknown line)
jl_apply at /cache/build/builder-amdci5-3/julialang/julia-master/src/julia.h:2189 [inlined]
true_main at /cache/build/builder-amdci5-3/julialang/julia-master/src/jlapi.c:900
jl_repl_entrypoint at /cache/build/builder-amdci5-3/julialang/julia-master/src/jlapi.c:1059
main at /cache/build/builder-amdci5-3/julialang/julia-master/cli/loader_exe.c:58
unknown function (ip: 0x7573c61cac87)
__libc_start_main at /usr/lib/libc.so.6 (unknown line)
unknown function (ip: 0x4010b8)
unknown function (ip: (nil))
Allocations: 1 (Pool: 1; Big: 0); GC: 0 |
Continuing from above, after second interrupt:
|
Em that loop might be infinite if innervals have circular bounds. julia> S = Tuple{Val{S1} where {S1<:T1}, Union{Int,T1}} where {T1}
Tuple{Val{S1} where S1<:T1, Union{Int64, T1}} where T1
julia> T = Tuple{Union{Int,T2}, Val{S2} where {S2<:T2}} where {T2}
Tuple{Union{Int64, T2}, Val{S2} where S2<:T2} where T2
julia> typeintersect(S, T) |> Base.has_free_typevars
true
julia> versioninfo()
Julia Version 1.10.3
Commit 0b4590a550 (2024-04-30 10:59 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: 16 × 12th Gen Intel(R) Core(TM) i7-12650H
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-15.0.7 (ORCJIT, alderlake)
Threads: 1 default, 0 interactive, 1 GC (on 16 virtual cores) |
Add the milestone as #53675 has been backported. |
…4545) The infinite loop encountered in #54516 has been traced back to a circular bound during `finish_unionall`. As we insert innervar more eagerly now, the direct `jl_has_typevar` could not find all circularity. To address this, `has_typevar_via_flatten_env` is added to perform thorough check. Although there is some code duplication with `reachable_var`, it could be improved in future refactoring. #54516 also highlighted another free var escaping regression since v1.10. This regression is not solely the result of incomplete checks, it is also caused by the missing final substitution of `vb`'s bound, which has now been corrected. At last, this PR adds an assertion of sorting complexity, which should facilitate the detection of similar issues by PkgEval. close #54516
…4545) The infinite loop encountered in #54516 has been traced back to a circular bound during `finish_unionall`. As we insert innervar more eagerly now, the direct `jl_has_typevar` could not find all circularity. To address this, `has_typevar_via_flatten_env` is added to perform thorough check. Although there is some code duplication with `reachable_var`, it could be improved in future refactoring. #54516 also highlighted another free var escaping regression since v1.10. This regression is not solely the result of incomplete checks, it is also caused by the missing final substitution of `vb`'s bound, which has now been corrected. At last, this PR adds an assertion of sorting complexity, which should facilitate the detection of similar issues by PkgEval. close #54516 (cherry picked from commit 92dfdca)
This problem seems to have been backported on 1.11 beta2. |
Yes, backporting #54545 will fix that. |
…4545) The infinite loop encountered in #54516 has been traced back to a circular bound during `finish_unionall`. As we insert innervar more eagerly now, the direct `jl_has_typevar` could not find all circularity. To address this, `has_typevar_via_flatten_env` is added to perform thorough check. Although there is some code duplication with `reachable_var`, it could be improved in future refactoring. #54516 also highlighted another free var escaping regression since v1.10. This regression is not solely the result of incomplete checks, it is also caused by the missing final substitution of `vb`'s bound, which has now been corrected. At last, this PR adds an assertion of sorting complexity, which should facilitate the detection of similar issues by PkgEval. close #54516
…liaLang#54545) The infinite loop encountered in JuliaLang#54516 has been traced back to a circular bound during `finish_unionall`. As we insert innervar more eagerly now, the direct `jl_has_typevar` could not find all circularity. To address this, `has_typevar_via_flatten_env` is added to perform thorough check. Although there is some code duplication with `reachable_var`, it could be improved in future refactoring. JuliaLang#54516 also highlighted another free var escaping regression since v1.10. This regression is not solely the result of incomplete checks, it is also caused by the missing final substitution of `vb`'s bound, which has now been corrected. At last, this PR adds an assertion of sorting complexity, which should facilitate the detection of similar issues by PkgEval. close JuliaLang#54516
MWE:
FTR this makes it impossible to compile LaurentPolynomials.jl.
Version info:
The text was updated successfully, but these errors were encountered: