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

Internal error with StackOverflowError while compiling a function #37872

Closed
rfourquet opened this issue Oct 3, 2020 · 1 comment · Fixed by #37896
Closed

Internal error with StackOverflowError while compiling a function #37872

rfourquet opened this issue Oct 3, 2020 · 1 comment · Fixed by #37896
Assignees
Labels
bug Indicates an unexpected problem or unintended behavior compiler:codegen Generation of LLVM IR and native code

Comments

@rfourquet
Copy link
Member

MWE:

julia> function swapliterals!(@nospecialize(swaps::AbstractDict))
           swaps === Base.ImmutableDict(Int128 => :big)
       end
swapliterals! (generic function with 1 method)

julia> swapliterals!(Dict(Int=>Int))
Internal error: encountered unexpected error during compilation of swapliterals!:
StackOverflowError()
jl_type_intersection_env_s at /local/src/julia/src/subtype.c:3305
emit_f_is at /local/src/julia/src/codegen.cpp:2553
emit_bits_compare at /local/src/julia/src/codegen.cpp:2503
operator() at /local/src/julia/src/codegen.cpp:2573
emit_guarded_test<emit_f_is(jl_codectx_t&, const jl_cgval_t&, const jl_cgval_t&, llvm::Value*, llvm::Value*)::<lambda()>&> at /local/src/julia/src/codegen.cpp:
2322
operator() at /local/src/julia/src/codegen.cpp:2354 [inlined]
[...]
@yuyichao
Copy link
Contributor

yuyichao commented Oct 3, 2020

Direct repro is code_llvm((a, b)->a === b, Tuple{Base.ImmutableDict{Int,Int},Base.ImmutableDict{Int,Int}}). So there needs to be a detection for loops when comparing immutables...

@JeffBezanson JeffBezanson added bug Indicates an unexpected problem or unintended behavior compiler:codegen Generation of LLVM IR and native code labels Oct 5, 2020
@JeffBezanson JeffBezanson self-assigned this Oct 6, 2020
@vchuravy vchuravy mentioned this issue Jan 21, 2021
27 tasks
vchuravy pushed a commit that referenced this issue Jan 22, 2021
vchuravy pushed a commit that referenced this issue Jan 22, 2021
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