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: stack overflow in type inference when displaying an array with 511 dimensions #48813

Closed
Seelengrab opened this issue Feb 27, 2023 · 1 comment
Labels
arrays [a, r, r, a, y, s] bug Indicates an unexpected problem or unintended behavior display and printing Aesthetics and correctness of printed representations of objects.

Comments

@Seelengrab
Copy link
Contributor

Seelengrab commented Feb 27, 2023

@oxinabox asked on Slack about ndims in array.c, which resulted in me wanting to see what an array with the maximum number of dimensions would look like:

julia> f(::Val{n}) where n = Array{UInt, n}(undef, ntuple(_ -> 1, n))
f (generic function with 1 method)

julia> f(Val(511))
1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×1 Array{UInt64, 511}:
[:, :, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1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Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64, Int64).
This might be caused by recursion over very long tuples or argument lists.
Internal error: stack overflow in type inference of (::Type{Base.SubArray{T, N, P, I, L} where L where I where P where N where T})(Base.IndexCartesian, Array{UInt64, 511}, Tuple{Base.UnitRange{Int64}, Base.UnitRange{Int64}, Vararg{Int64, 509}}, Tuple{Bool, Bool}).
This might be caused by recursion over very long tuples or argument lists.
Internal error: stack overflow in type inference of print_matrix(Base.IOContext{Base.TTY}, Base.SubArray{UInt64, 2, Array{UInt64, 511}, Tuple{Base.UnitRange{Int64}, Base.UnitRange{Int64}, Vararg{Int64, 509}}, false}).
This might be caused by recursion over very long tuples or argument lists.
Internal error: stack overflow in type inference of isassigned(Base.SubArray{UInt64, 2, Array{UInt64, 511}, Tuple{Base.UnitRange{Int64}, Base.UnitRange{Int64}, Vararg{Int64, 509}}, false}, Int64, Int64).
This might be caused by recursion over very long tuples or argument lists.
 Internal error: stack overflow in type inference of isassigned(Base.SubArray{UInt64, 2, Array{UInt64, 511}, Tuple{Base.UnitRange{Int64}, Base.UnitRange{Int64}, Vararg{Int64, 509}}, false}, Int64, Int64).
This might be caused by recursion over very long tuples or argument lists.
0x0000000000000000

julia> versioninfo()
Julia Version 1.10.0-DEV.656
Commit f0eadd076f* (2023-02-24 16:50 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: 24 × AMD Ryzen 9 7900X 12-Core Processor
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, znver3)
  Threads: 24 on 24 virtual cores
Environment:
  JULIA_NUM_THREADS = 24

It seems to start breaking on my machine at ~410 dimensions, but that's likely to be machine specific.

@nsajko
Copy link
Contributor

nsajko commented Oct 1, 2024

Fixed by #55575

@nsajko nsajko closed this as completed Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrays [a, r, r, a, y, s] bug Indicates an unexpected problem or unintended behavior display and printing Aesthetics and correctness of printed representations of objects.
Projects
None yet
Development

No branches or pull requests

3 participants