Skip to content

ArrayPartition([1,1],[1])[1:3,1] segfaults. #273

Description

@Jollywatt

Tested on Julia v1.9.3 and v1.10.0-beta2. Definitely RAT’s fault…

I’m not sure what the semantics for multidimensional indexing is meant to be for ArrayPartitions, but I assume a[1:3,1] means elements 1 through 3 of the first partition, hence the error. (Shouldn’t it mean rows 1 through 3 and column 1, like any other array? Anyway, that’s a separate issue…)

Details
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.9.3 (2023-08-24)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> versioninfo()
Julia Version 1.9.3
Commit bed2cd540a1 (2023-08-24 14:43 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: macOS (x86_64-apple-darwin22.4.0)
  CPU: 8 × Intel(R) Core(TM) i7-3740QM CPU @ 2.70GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, ivybridge)
  Threads: 1 on 8 virtual cores
Environment:
  JULIA_EDITOR = subl

(@v1.9) pkg> st
Status `~/.julia/environments/v1.9/Project.toml`
  [6e4b80f9] BenchmarkTools v1.3.2
  [31a5f54b] Debugger v0.7.8
  [559a0405] DiffGeoToy v0.1.0 `../../../Documents/JuliaPackages/DiffGeoToy`
  [0c46a032] DifferentialEquations v7.9.0 `~/.julia/dev/DifferentialEquations`
  [5fb14364] OhMyREPL v0.5.22
  [731186ca] RecursiveArrayTools v2.38.7 `~/.julia/dev/RecursiveArrayTools`
  [295af30f] Revise v3.5.3

julia> using RecursiveArrayTools

julia> ArrayPartition([1,1], [1])[1:3,1]

[15282] signal (11.1): Segmentation fault: 11
in expression starting at REPL[19]:1
getindex at ./essentials.jl:13 [inlined]
getindex at /Users/jollywatt/.julia/dev/RecursiveArrayTools/src/array_partition.jl:227 [inlined]
macro expansion at ./multidimensional.jl:889 [inlined]
macro expansion at ./cartesian.jl:64 [inlined]
_unsafe_getindex! at ./multidimensional.jl:884 [inlined]
_unsafe_getindex at /Users/jollywatt/.julia/dev/RecursiveArrayTools/src/array_partition.jl:263
_getindex at ./multidimensional.jl:861 [inlined]
getindex at ./abstractarray.jl:1296
unknown function (ip: 0x107f2d850)
ijl_apply_generic at /Users/jollywatt/.julia/juliaup/julia-1.9.3+0.x64.apple.darwin14/lib/julia/libjulia-internal.1.9.dylib (unknown line)
do_call at /Users/jollywatt/.julia/juliaup/julia-1.9.3+0.x64.apple.darwin14/lib/julia/libjulia-internal.1.9.dylib (unknown line)
eval_body at /Users/jollywatt/.julia/juliaup/julia-1.9.3+0.x64.apple.darwin14/lib/julia/libjulia-internal.1.9.dylib (unknown line)
…

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions